Library with some useful operations for the Either
data type.
Exported Functions: fromLeft, fromRight, isLeft, isRight, lefts, partitionEithers, rights
Extracts from a list of Either
all the Left
elements in order.
Extracts from a list of Either
all the Right
elements in order.
Return True
if the given value is a Left
-value, False
otherwise.
Return True
if the given value is a Right
-value, False
otherwise.
Extract the value from a Left
constructor.
Extract the value from a Right
constructor.
partitionEithers
:: [Either a b] -> ([a], [b])
Partitions a list of Either
into two lists.
All the Left
elements are extracted, in order, to the first
component of the output. Similarly the Right
elements are extracted
to the second component of the output.