Data.Either
Description
data Either a b #
Constructors
either :: (a -> c) -> (b -> c) -> Either a b -> c #
Case analysis for the Either type. If the value is Left a, apply the first function to a; if it is Right b, apply the second function to b.
Either
Left a
Left
a
Right b
Right
b
either f g (Left x) = f x either f g (Right y) = g y