[Haskell-beginners] Understanding Monadic I/O
dav.vire+haskell at gmail.com
Thu Jan 14 07:52:01 EST 2010
On Mon, Jan 11, 2010 at 2:57 PM, Markus Böhm
<markus.boehm at googlemail.com> wrote:
> Hi, I'd like to understand in principle, how monadic I/O actions and
> combinators (>>=) are translated into imperative C--, to be executed
> Does sequencing of IO actions mean nesting of C-- functions and
> passing values/state via additional function parameters?
> Is there any material with examples available?
Perhaps you could download JHC and compile with the -d c flag.
It writes the C code, and JHC writes more understandable C code
compared to GHC (IMHO)
main = putStrLn "hello, world" >> putStrLn "hello again, world"
[lots of stuff]
static void A_STD
so in this simple example you see there's no nesting of functions.
More information about the Beginners