On 26 December 2010 19:00, michael rice <[email protected]> wrote:
>
> 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.

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to