[Haskell-cafe] Monad explanation
tmorris at tmorris.net
Mon Feb 9 05:14:21 EST 2009
-----BEGIN PGP SIGNED MESSAGE-----
You're right - my statement is inaccurate.
Implementation details aside, I am referring specifically to the
statement "getChar ... has the type signature of a value". It clearly
Lennart Augustsson wrote:
> Not it doesn't. getChar has the type signature IO Char. The IO
> type is abstract. GHC happens to implement it by a state monad.
> But in, e.g., hbc it is implemented in a totally different way,
> more like a continuation monad.
> Peeking inside an implementation of IO can be illuminating, but one
> must remember that IO is abstract.
> -- Lennart
> On Mon, Feb 9, 2009 at 10:26 AM, Tony Morris <tmorris at tmorris.net>
> wrote: Gregg Reynolds wrote:
>>>> The point being that the metalanguage commonly used to
>>>> describe IO in Haskell contains a logical contradiction. A
>>>> thing cannot be both a value and a function, but e,g, getChar
>>>> behaves like a function and has the type signature of a
> getChar has the signature RealWorld -> (RealWorld, Char)
Haskell-Cafe mailing list
Haskell-Cafe at haskell.org
S, K and I ought to be enough for anybody.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Haskell-Cafe