No longer require largeword < 1.2 to compile on GHC 7.4.1
[rootstock.git] / Util / Either.hs
blobdff0305d82d0268f075d6ada200e6c5153ac90f7
1 module Util.Either where
3 isLeft :: Either a b -> Bool
4 isLeft (Left _) = True
5 isLeft _ = False
7 isRight :: Either a b -> Bool
8 isRight = not . isLeft
10 doLeft :: Monad m => (a -> m ()) -> Either a b -> m ()
11 doLeft f (Left x) = f x
12 doLeft _ _ = return ()