[Haskell-cafe] Either instance of Monad?

Yves Parès limestrael at gmail.com
Wed Feb 23 09:58:56 CET 2011


I am using mtl-2. Importing Control.Monad.Error doesn't work, I have
to explicitly import Control.Monad.Instances.


2011/2/22 Daniel Fischer <daniel.is.fischer at googlemail.com>:
> On Tuesday 22 February 2011 23:07:05, Yves Parès wrote:
>> Hello,
>>
>> When importing Control.Monad.Error, it shows me that (Either e) is an
>> instance of MonadFix, but not an instance of Monad.
>> Isn't there a problem?
>
> Prelude Control.Monad.Error> :i Either
> data Either a b = Left a | Right b      -- Defined in Data.Either
> instance (Eq a, Eq b) => Eq (Either a b) -- Defined in Data.Either
> instance Monad (Either e) -- Defined in Control.Monad.Instances
> instance Functor (Either a) -- Defined in Control.Monad.Instances
> <snip>
> instance MonadFix (Either e) -- Defined in Control.Monad.Fix
> <snip>
>
> Works right here. With mtl-1.*, there's an (Error e) restriction on the
> instances.
>
>



More information about the Haskell-Cafe mailing list