haskell2010-base
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Either

Description

 
Synopsis

Documentation

data Either a b #

Constructors

Left a 
Right b 

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.

Specification:

Expand
either f g (Left x)  =  f x
either f g (Right y) =  g y