[Haskell-beginners] Question on data/type

Daniel Fischer daniel.is.fischer at web.de
Tue Nov 17 22:59:41 EST 2009


Am Mittwoch 18 November 2009 03:46:45 schrieb Phillip Pirrip:
> BTW, how do I generate "literate" Haskell code?  I keep reading it but I
> still don't know how to make one (I am assuming it is more complicated then
> just type the code in with ">" in emacs).
>
> //pip

No, it isn't. The hardest part is writing good code and comments (regardless of whether 
you write literate code or 'normal').

There are two ways of writing literal Haskell code, explained at 
http://haskell.org/onlinereport/syntax-iso.html#sect9.4 .

a) 'Bird tack', start code lines with '>', write as normal (you can include -- and {- -} 
comments). *Separate '>'-lines from non-code lines by at least one blank line*.

b) 'LaTeX' literate Haskell, code is begun by a line starting with "\begin{code}" and 
ended by "\end{code}". You can create really pretty stuff with that style.


More information about the Beginners mailing list