I find it convenient sometimes to convert a Maybe value to an Either thus 
(excuse the syntax, it's CAL, not Haskell):

maybeToEither :: a -> Maybe b -> Either a b;
maybeToEither errorValue = maybe (Left errorValue) (\x -> Right x);

but that seemingly obvious function isn't in Hoogle, AFAICT, so perhaps there's 
some other approach?

Thanks,
  Tom_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to