[Haskell-cafe] Funny State monad dependency

Hans Aberg haberg at math.su.se
Wed Apr 16 10:08:09 EDT 2008


On 16 Apr 2008, at 15:14, Miguel Mitrofanov wrote:
> Before somebody noticed: I'm wrong.
>
> It's not List monad, but also a "(->) x" monad, also defined in  
> Control.Monad.
>
> Therefore, "return y" is just "const y". Therefore,
>
> x >>= (return y) = x >>= (const y) = x >> y

Right. It is an interesting monad, but it may cause unexpected  
effect, in view of its implicit name.

   Hans




More information about the Haskell-Cafe mailing list