control v0.1.0 Data.Either

The Data.Either type represents values with two possibilities: left(a) or right(b).

The Either type is sometimes used to represent a value which is either correct or an error; by convention, the left/1 constructor is used to hold an error value and the right/1 constructor is used to hold a correct value (mnemonic: “right” also means “correct”).

Link to this section Summary

Functions

The left (“error”) constructor

The right (“correct”) constructor

Link to this section Types

Link to this type t()
t() :: %Data.Either{left: term(), right: term()}

Link to this section Functions

Link to this function left(v)
left(term()) :: t()

The left (“error”) constructor.

Link to this function right(v)
right(term()) :: t()

The right (“correct”) constructor.