Content deleted Content added
Jerryobject (talk | contribs) Template:More footnotes update > Template:More footnotes needed. Template:Infobox programming language parameter: reorder, standardize, conform to master template. Whitespace characters cut to standardize, aid work via small screens. WP:LINKs: update-standardizes, needless WP:PIPEs > WP:NOPIPEs. |
|||
Line 1:
{{
{{Infobox programming language
| name
| logo
| logo caption
| screenshot
| screenshot caption
| file ext
| paradigm
| scope
| released = {{Start date and age|1985}}▼
▲ | designer = [[David Turner (computer scientist)|David Turner]]
▲ | developer = Research Software Ltd
| latest release version =
| latest release date
| latest preview version =
| latest preview date
| typing
| implementations
| dialects
| influenced by
| influenced
| programming language
| platform
| operating system
| license
| website
| wikibooks
}}
'''Miranda''' is a [[lazy evaluation|lazy]], [[functional programming|purely functional]] [[programming language]] designed by [[David Turner (computer scientist)|David Turner]] as a successor to his earlier programming languages [[SASL programming language|SASL]] and [[Kent Recursive Calculator|KRC]], using some concepts from [[ML (programming language)|ML]] and [[Hope (programming language)|Hope]].
Miranda was first released in 1985 as a fast interpreter in [[C (programming language)|C]] for [[Unix]]-flavour operating systems, with subsequent releases in 1987 and 1989. It had a strong influence on the later [[
In 2020 a version of Miranda was released as open source under a [[BSD 2-Clause|BSD licence]]. The codebase has been updated to conform to modern C standards ([[C11 (C standard revision)|C11]]/[[C18 (C standard revision)|C18]]) and to generate 64-bit binaries. This has been tested on operating systems including [[Debian]], [[Ubuntu]], [[Windows Subsystem for Linux|WSL]]/Ubuntu, and [[
== Overview ==
Miranda is a [[lazy evaluation|lazy]], [[functional programming|purely functional]] programming language. That is, it lacks [[Side effect (computer science)|side effect]]s and [[imperative programming]] features. A Miranda program (called a ''script'') is a set of [[equation]]s that define various mathematical [[function (mathematics)|function]]s and [[algebraic data type]]s. The word ''[[
Since the [[parsing]] algorithm makes intelligent use of layout (indentation, via [[off-side rule
[[Comment (computer programming)|Comment]]ary is introduced into regular scripts by the characters <code>||</code> and continue to the end of the same line. An alternative commenting convention affects an entire source code file, known as a "[[Literate programming|literate script]]", in which every line is considered a comment unless it starts with a <code>></code> sign.
Line 48:
</syntaxhighlight>
The ''[[
<syntaxhighlight lang="haskell">
Line 88:
The notation for function application is simply juxtaposition, as in <code>sin x</code>.
In Miranda, as in most other purely functional languages, functions are [[first-class function|first-class]] citizens, which is to say that they can be passed as [[parameter (computer science)|arguments]] to other functions, returned as results, or included as elements of data structures.
<syntaxhighlight lang="haskell">
Line 104:
</syntaxhighlight>
is the briefest way to create a function that adds one to its argument.
<syntaxhighlight lang="haskell">
Line 256:
isAvl (N l w r) = and (isAvl l) (isAvl r), if amount ((nodecount l) - (nodecount r)) < 2
= False, otherwise
delete :: * -> tree * -> tree *
delete x E = E
|