[Haskell-cafe] Are all monads functions?

Chris Smith cdsmith at gmail.com
Sat Dec 31 14:26:43 CET 2011


On Dec 31, 2011 8:19 AM, "Yves Parès" <limestrael+haskell at gmail.com> wrote:
> -- The plain Maybe type
> data Maybe a = Just a | Nothing
>
> -- The MaybeMonad
> newtype MaybeMonad a = MM ( () -> Maybe a )
>
> That's what using Maybe as a monad semantically means, doesn't it?

I'd have to say no.  That Maybe types are isomorphic to functions from ()
is not related to their being monads... indeed it's true of all types.  I'm
not sure what meaning you see in the function, but I don't see anything of
monads in it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111231/fac90990/attachment.htm>


More information about the Haskell-Cafe mailing list