
2 Aug
2010
2 Aug
'10
10:14 a.m.
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