[Haskell-cafe] Re: what is inverse of mzero and return?

Jules Bean jules at jellybean.co.uk
Tue Jan 25 09:29:12 EST 2005


On 25 Jan 2005, at 13:20, Keean Schupke wrote:

>       f = getChar >>= (\a -> if a == "F" then mzero else return a)
>
>    In this case if the LHS returns "F" the LHS should not have been 
> run... this contradicts itself, so
>    this is a non option I guess.

Good paradox. That is what is upsetting me, too.

> Acutally looking at GHC CVS libraries, there is not a definition for 
> MonadPlus on the state or IO
> monads...
>

It's in Control.Monad.Error. Not documented though.

Jules



More information about the Haskell-Cafe mailing list