[Haskell-cafe] Request to review my attempt at understanding Monads

Jason Dusek jason.dusek at gmail.com
Tue Dec 29 04:05:21 EST 2009


2009/12/29 Alexander Solla <ajs at 2piix.com>:
> Every Monad defines a "join" and "eval" function in terms of
> bind and return, and the Monad type class does this for you.
> You can use "join" to construct queries against a monad, and
> eval to "run" a monad, like a state machine. (Conceptually,
> the Haskell runtime calls the IO monad's "specially defined"
> eval method on "Main.main". This is the only Haskell monad
> whose eval function is not defined in terms of >>= and return,
> as far as I know.)

  Maybe I am misunderstanding you, but `eval :: M t -> t' does
  not fall out of the definition of a monad. You need more than
  monadicity -- you need an algebra for `M' at `t'.

--
Jason Dusek


More information about the Haskell-Cafe mailing list