The Miranda Programming Language
Click below to go directly to a specific section:
Significant Language Features |
Areas of Application |
Related Links |
Printed References |
Miranda was developed in 1985-86 by David Turner, and is now currently
being marketed by Research Software Ltd. of England. Miranda was
the successor of the functional languages SASL and KRC. With Miranda,
the main goal was to produce a commercial version of a standard non-strict
purely functional language. To make Miranda commercially viable,
the development environment had to be made very flexible and easy-to-use.
Significant Language Features
Miranda, A Non-Strict Purely Functional Language
In Non-Strict functional languages, the arguments to a function are
not evaluated until they are actually required within the functions being
called. Therefore, any parameter can be passed to a function and
until it is needed in that function, this parameter is not evaluated.
This is also known as lazy evaluation, and the main advantage of using
this method is that it allows for passing infinite element data structures
to a function.
- Purely Functional:
Pure functional languages perform all computation using function application.
"Side-effect" features such as destructive assignments and looping are
not even provided within the language, and therefore all programs have
to strictly adhere to the functional approach of programming.
- Characteristics of Functional Languages
Develop a clean simple semantic model which uses the function as the basis
The order of execution is irrelevant.
Compared to imperative languages, functional languages:
Allow a more concise representation (higher level of abstraction).
Decrease development time.
- Basic Data Structures
Lists - defined as a set of homogeneously typed values. The
list data structure is an extremely powerful feature of Miranda.
It allows quick and simple list processing and also allows infinite lists.
Tuple - a non-homogenous sequence of values which can be utilized
to form enumerated data types or even form complex data structures such
Laws - produce "non-free" data types. Two examples of these
"non-free" data types are constrained data types and data types with memorized
Areas of Application
The main uses of Miranda are:
teaching functional programming
as a specification language
research into functional programming
a general purpose programming tool
sort  = 
sort (a:x) = sort [ b | b <- x; b<=a ]
++ [a] ++
sort [ b | b <- x; b>a ]
fac 0 = 1
fac (n+1) = (n+1)*fac n
- Ackermann's function
ack 0 n = n+1
ack (m+1) 0 = ack m 1
ack (m+1) (n+1) = ack m (ack (m+1) n)
Thompson, Simon. "Laws in Miranda." ACM Communications, Vol. 2,
Iss. 3, 1986
Dr. David Turner, the creator of Miranda, provided much of the information
used to create this page .
Miranda is a trademark of Research Software Limited of Europe.
Last modified: 3:29 PM on 12/16/1997
Created by: Stacey Miller & Tony Vitale
Trimmed by: Martin Guy <firstname.lastname@example.org>