Take the 2-minute tour ×  I was under the impression that there
was an instance for Either a somewhere, but I can't seem to find
it. I have tried importing Control.Monad,
Control.Monad.Instances and Data.Either as shown  module Main
where  import Control.Monad import Data.Either import
Control.Monad.Instances  test :: [Either a b] -> Either a [b]
test = sequence  main = return ()  but ghc tells me that it
could not deduce (Monad (Either a)). Adding  instance Monad
(Either a) where     return = Right     Right b >>= f = f b
Left a >>= _ = Left a  makes the code compile, but this instance
declaration seems so general that it doesn't make sense to me if
it isn't already out there in some standard module. If it is,
where should I look to find it, and if it isn't, is there then a
reason for this?  share|improve this question The reason for the
stupid error constraint is to make fail work "properly." Yet
another reason why the fail method is a failure. –  sclv Feb 25
'11 at 0:53 @sclv: I'm not sure I follow. Th