MonadPlus instance for IO

I'm sure I'm doing something stupid, but somehow ghc isn't recognizing the existance of a MonadPlus instance for IO: DarcsIO.lhs:48: No instance for (MonadPlus IO) arising from use of `mplus' at DarcsIO.lhs:48 In the definition of `foo': foo = (fail "aaack") `mplus` (fail "foobar") Any idea what I'm doing wrong? I'm using $ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.2.2 packaged for debian. -- David Roundy http://www.darcs.net

Am Mittwoch, 2. Februar 2005 14:17 schrieb David Roundy:
I'm sure I'm doing something stupid, but somehow ghc isn't recognizing the existance of a MonadPlus instance for IO:
DarcsIO.lhs:48: No instance for (MonadPlus IO) arising from use of `mplus' at DarcsIO.lhs:48 In the definition of `foo': foo = (fail "aaack") `mplus` (fail "foobar")
Any idea what I'm doing wrong? I'm using
$ ghc --version The Glorious Glasgow Haskell Compilation System, version 6.2.2
packaged for debian.
Probably you haven't imported 'Control.Monad.Error', where the instance is defined. I did and all went well. Cheers, Daniel

On Wed, Feb 02, 2005 at 02:41:42PM +0100, Daniel Fischer wrote:
Probably you haven't imported 'Control.Monad.Error', where the instance is defined. I did and all went well.
Thanks, that did it. It's confusing that the instance is documented in Control.Monad. -- David Roundy http://www.darcs.net

Am Mittwoch, 2. Februar 2005 14:48 schrieb David Roundy:
On Wed, Feb 02, 2005 at 02:41:42PM +0100, Daniel Fischer wrote:
Probably you haven't imported 'Control.Monad.Error', where the instance is defined. I did and all went well.
Thanks, that did it. It's confusing that the instance is documented in Control.Monad.
Yes, very confusing, but what could one do? Maybe urge people to mention instance declarations in the module description, so from the absence of one, you are led to look elsewhere. But that might make descriptions unduly large sometimes. Daniel
participants (2)
-
Daniel Fischer
-
David Roundy