[Haskell-cafe] Curry and Reader monad

Daryoush Mehrtash dmehrtash at gmail.com
Thu May 7 19:45:05 EDT 2009

In the  Is currying
the author says:

This is again a nested expression. So I wondered if you could again
> "flatten" it with a monadic do block:
>     let add3 = do
>         a <- get first parameter
>         b <- get second parameter
>         c <- get third parameter
>         return a+b+c
> OK, so I "know" that functions in Haskell (which uses currying for
> functions as a general rule) are the "Reader monad". But I don't understand
> it well enough to know if that means you can use Reader to implement the
> above...
> (I don't understand Reader at all in fact. I must bang my head against it
> again, but I find it very confusing - how the monad is represented, what the
> functions are, and how they get magically applied.)

Any idea what he is talking about?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090507/6d4f9c7f/attachment.htm

More information about the Haskell-Cafe mailing list