Reference documentation for Daml module DA.Either.
Daml module
DA.Either
The Either type represents values with two possibilities.
Daml
ModuleDA.Either
Latest release3.7.5
Functions
lefts
lefts : [Eitherab] -> [a]Extracts all the Left elements from a list.
rights
rights : [Eitherab] -> [b]Extracts all the Right elements from a list.
partitionEithers
partitionEithers : [Eitherab] -> ([a], [b])Partitions a list of Either into two lists, the Left and
Right elements respectively. Order is maintained.
isLeft
isLeft : Eitherab -> BoolReturn True if the given value is a Left-value, False
otherwise.
isRight
isRight : Eitherab -> BoolReturn True if the given value is a Right-value, False
otherwise.
fromLeft
fromLeft : a -> Eitherab -> aReturn the contents of a Left-value, or a default value
in case of a Right-value.
fromRight
fromRight : b -> Eitherab -> bReturn the contents of a Right-value, or a default value
in case of a Left-value.
optionalToEither
optionalToEither : a -> Optionalb -> EitherabConvert a Optional value to an Either value, using the supplied
parameter as the Left value if the Optional is None.
eitherToOptional
eitherToOptional : Eitherab -> OptionalbConvert an Either value to a Optional, dropping any value in
Left.