So, it’s been a few months and I’m a bit rusty, but I seem to remember Either b being a Monad
Prelude Control.Monad Data.Either> return "Hello" :: Either String String
<interactive>:0:1:
No instance for (Monad (Either String))
arising from a use of `return'
Possible fix:
add an instance declaration for (Monad (Either String))
In the expression: return "Hello" :: Either String String
In an equation for `it':
it = return "Hello" :: Either String String
Prelude> Right "Hi" == return "Hi"
<interactive>:0:15:
No instance for (Monad (Either a0))
arising from a use of `return'
Possible fix: add an instance declaration for (Monad (Either a0))
In the second argument of `(==)', namely `return "Hi"'
In the expression: Right "Hi" == return "Hi"
In an equation for `it': it = Right "Hi" == return "Hi"
So I’m probably doing something wrong, but I’m not sure what. I’m using GHC 7.2.2.
Import
Control.Monad.Trans.ErrororControl.Monad.Error.Either amonad instances are usually used in error handlings.