View Source Funx.Monad.Either.Left (funx v0.1.7)
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 betweenLeftand otherEithervalues.Funx.Foldable: Providesfold_l/3andfold_r/3to handle folding forLeftvalues.Funx.Monad: Implements thebind/2,map/2, andap/2functions for monadic operations.Funx.Ord: Defines ordering logic forLeftandRightvalues.
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"}