
30 Oct
2014
30 Oct
'14
9:42 a.m.
Dear Haskell-Cafe, Is there a way to get Control.Applicative.<|> to short-circuit when combining two IO actions? E.g.
let a = putStrLn "A" >> return (Left "hehe") let b = putStrLn "B" >> return (Right 42)
Prelude> liftA2 (<|>) a b
A B Right 42
liftA2 (<|>) b a
B A Right 42 (In the latter case I don't want A in the output…) Many thanks for your help, Semen -- Семен Тригубенко http://trygub.com