
On Sat, Nov 01, 2014 at 04:22:28AM +0700, Kim-Ee Yeoh wrote:
On Thu, Oct 30, 2014 at 8:50 PM, Roman Cheplyaka
wrote: 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
With the latest transformers, I still get
B A Right 42
i.e. the A hasn't been eliminated.
What am I missing?
In the actual use case ErrorT was already wrapping IO and that's what I was combining with <|>, so, for now, lacking the latest transformers, I have written a custom infix operator. I haven't had a chance to test Roman's solution and assumed it to be correct. So your observation is a valuable "data point" — thank you! Apologies, I should have tested this myself sooner, S. -- Семен Тригубенко http://trygub.com