[Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread 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.
-- 
David Roundy
http://www.darcs.net
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


RE: [Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread Simon Peyton-Jones
that instance seems to be only in Control.Monad.Error in the 'mtl'
package.  It's not in the standard base package.

You may need to import an mtl module to tell GHC to look there.

Simon

| -Original Message-
| From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
| David Roundy
| Sent: 02 February 2005 13:18
| To: haskell-cafe@haskell.org
| Subject: [Haskell-cafe] 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
| ___
| Haskell-Cafe mailing list
| Haskell-Cafe@haskell.org
| http://www.haskell.org/mailman/listinfo/haskell-cafe
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] MonadPlus instance for IO

2005-02-02 Thread Daniel Fischer
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
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe