extra-0.3.1: Extra functions I use.

Safe HaskellSafe-Inferred

Data.Either.Extra

Synopsis

Documentation

isLeft :: Either t t1 -> BoolSource

isRight :: Either t t1 -> BoolSource

fromLeft :: Either l r -> lSource

The fromLeft function extracts the element out of a Left and throws an error if its argument is Right. Much like fromJust, using this function in polished code is usually a bad idea.

fromRight :: Either l r -> rSource

The fromRight function extracts the element out of a Right and throws an error if its argument is Left. Much like fromJust, using this function in polished code is usually a bad idea.

fromEither :: Either a a -> aSource

Pull the value out of an Either where both alternatives have the same type.