[Haskell-cafe] Re: Parsers are monadic?
gregorypropf at yahoo.com
Mon Jul 2 17:02:44 EDT 2007
Right, I read more about it and found this out. The 'main' function is apparently magical at runtime and allows you to break the with pure functionality just once but since it can call other functions this allows for useful programs to be written.
----- Original Message ----
From: Jules Bean <jules at jellybean.co.uk>
To: Gregory Propf <gregorypropf at yahoo.com>
Cc: haskell-cafe at haskell.org
Sent: Monday, July 2, 2007 1:40:09 AM
Subject: Re: [Haskell-cafe] Re: Parsers are monadic?
Gregory Propf wrote:
> Thanks, that was helpful. I didn't realize that there were pure
> functional monads.
Actually, it's stronger than that. All monads are pure functional, even
IO. Haskell is an entirely 100% pure functional language[*]. The IO
monad allows you to build up, in a pure, referentially transparent way,
an object call an 'IO action' which you have no way of actually
executing, per se.
Fortunately, this isn't as useless as it sounds since the runtime system
contains the support to "actually run" the special IO action called
'main', which bootstraps the whole setup.
[*] non-functions like unsafePerformIO are not technically part of the
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe