>> liftA2 (<|>) b a
>
> B
> A
> Right 42
>
> (In the latter case I don't want A in the output…)
Wrap it into ExceptT (from the latest transformers), as in
runExceptT $ ExceptT a <|> ExceptT b
I don't know what you're missing, but when I run the following code, it
doesn't print A.
import Control.Monad.Except
import Control.Applicative
a = putStrLn "A" >> return (Left "hehe")
b = putStrLn "B" >> return (Right 42)
main = runExceptT $ ExceptT b <|> ExceptT a
Roman