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.
Michael
==
import Control.Monad
import
On 26 December 2010 19:00, michael rice nowg...@yahoo.com 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.
On Dec 26, 2010 2:01 PM, michael rice nowg...@yahoo.com 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 _ -
On Sun, Dec 26, 2010 at 2:00 PM, michael rice nowg...@yahoo.com wrote:
instance Monad m = MonadPlus (MaybeT m) where
mzero = MaybeT $ return Nothing
mplus x y = MaybeT $ do maybe_value - runMaybeT x
case maybe_value of
On Sun, 26 Dec 2010, Antoine Latter wrote:
I haven't had a chance to dig into your example, but you might want to try the
maybeT library:
http://hackage.haskell.org/package/MaybeT
That way you could try to narrow down where the error is coming from.
MaybeT is also part of transformers
On Sunday 26 December 2010 20:00:02, michael rice 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.
It loops
On Sun, 26 Dec 2010, David Menendez wrote:
instance Show (MaybeT m a)
This is never valid. You've defined show, shows, and showsPrec in terms of each
other, creating
unbounded recursion. Delete it.
Unfortunately, the -Wall option of GHC won't help here, since all the
methods are
generalising the type(s) for `mplus'
In the instance declaration for `MonadPlus (MaybeT m)'
Failed, modules loaded: none.
--- On Sun, 12/26/10, David Menendez d...@zednenem.com wrote:
From: David Menendez d...@zednenem.com
Subject: Re: [Haskell-cafe] Intro to monad transformers
To: michael
On Sunday 26 December 2010 21:21:00, michael rice wrote:
Ok, changed the last line and deleted the bad line. Maybe someone could
recommend a better example?
Michael
=
Prelude :l test5
[1 of 1] Compiling Main ( test5.hs, interpreted )
test5.hs:16:4:
Occurs
Ok, that works. On to code reading and, hopefully, enlightenment.
Thanks, all.
Michael
--- On Sun, 12/26/10, Daniel Fischer daniel.is.fisc...@googlemail.com wrote:
From: Daniel Fischer daniel.is.fisc...@googlemail.com
Subject: Re: [Haskell-cafe] Intro to monad transformers
To: haskell-cafe
11 matches
Mail list logo