Funx.Monad.Either.Right
Mix.install([
{:funx, "~> 0.1.5"}
])
Overview
Represents the Right
variant of the Either
monad, used to model a success or valid result.
This module implements the following protocols:
-
Funx.Eq
: Defines equality checks betweenRight
and otherEither
values. -
Funx.Foldable
: Providesfold_l/3
andfold_r/3
to handle folding forRight
values. -
Funx.Monad
: Implements thebind/2
,map/2
, andap/2
functions for monadic operations. -
Funx.Ord
: Defines ordering logic forRight
andLeft
values.
The Right
monad represents a valid result, and the contained value is propagated through operations.
Function Examples
import Funx.Monad.Either.Right
alias Funx.Monad.Either.Right
Functions
pure/1
Creates a new Right
value.
The pure/1
function wraps a value in the Right
monad, representing a valid result.
Examples
pure(5)