Literate scripts

The standard comment convention for Miranda scripts is that anything from a pair of vertical bars to the end of a line is taken to be comment and ignored by the compiler, thus
        ||This is a comment
Everything else in the script is taken to be formal program text. In a literate script the presumption is reversed: everything is assumed to be comment, except for lines marked as code by a '>' in column 1. For example these lines
>  fac 0 = 1
>  fac (n+1) = (n+1)*fac n
would be taken as formal program text and could be preceded and/or followed by some narrative explaining what the code is doing

To minimise the danger that you will accidentally omit the '>" from one line of your formal text without the compiler noticing that something is wrong, sections of formal program text and sections of "narrative" must be separated by at least one blank line. Within the formal sections of a literate script the standard comment convention using "||" still applies.

A Miranda script is literate if either of the following applies

The '>' inverse-comment convention (and the "blank line" rule) were invented by Richard Bird of Oxford University Programming Research Group, and first appeared in the language Orwell1. Miranda adopted the idea soon afterwards (in 1986) and it has since been used in other languages, including Haskell [Peyton Jones 2003].

1. Philip Wadler "An Introduction to Orwell", Oxford University Programming Research Group, April 1985.

Miranda home