
26 Dec
2010
26 Dec
'10
2:17 p.m.
On 26 December 2010 19:00, michael rice
I lifted the code below from here:
http://en.wikibooks.org/wiki/Haskell/Monad_transformers
Since the wiki page doesn't say what needs to be imported, I'm guessing.
Not sure what is happening. Maybe someone can tell me.
instance Monad m => MonadPlus (MaybeT m) where mzero = MaybeT $ return Nothing mplus x y = MaybeT $ do maybe_value <- runMaybeT x case maybe_value of Nothing -> runMaybeT y Just value -> runMaybeT x
I haven't run the code but the definition of mplus here looks cyclic.