View Source Funx.Monad.Either.Left (funx v0.1.0)
Represents the Left
variant of the Either
monad, used to model an error or failure.
This module implements the following protocols:
Funx.Eq
: Defines equality checks betweenLeft
and otherEither
values.Funx.Foldable
: Providesfold_l/3
andfold_r/3
to handle folding forLeft
values.Funx.Monad
: Implements thebind/2
,map/2
, andap/2
functions for monadic operations.Funx.Ord
: Defines ordering logic forLeft
andRight
values.
The Left
monad propagates the wrapped error through operations without executing the success logic.
Summary
Functions
Creates a new Left
value.
Types
@type t(value) :: %Funx.Monad.Either.Left{left: value}
Functions
Creates a new Left
value.
The pure/1
function wraps a value in the Left
monad, representing an error or failure.
Examples
iex> Funx.Monad.Either.Left.pure("error")
%Funx.Monad.Either.Left{left: "error"}