Funx.Monad.Identity (funx v0.8.4)
View SourceThe Funx.Monad.Identity module represents the identity monad, where values are simply wrapped in a structure
and operations are applied directly to those values.
Functions
Protocols
This module implements the following protocols:
Funx.Monad: Implements thebind/2,map/2, andap/2functions for monadic operations.Funx.Eq: Defines equality checks forIdentityvalues.Funx.Ord: Defines ordering logic forIdentityvalues.Funx.Tappable: Executes side effects on the wrapped value viaFunx.Tappable.tap/2.String.Chars: Converts anIdentityvalue into a string representation.
Summary
Functions
Extracts the value from an Identity.
Creates a new Identity value by wrapping a given value.
Types
Functions
Extracts the value from an Identity.
Examples
iex> Funx.Monad.Identity.extract(Funx.Monad.Identity.pure(5))
5
@spec lift_eq(Funx.Eq.eq_map()) :: Funx.Eq.eq_map()
@spec lift_ord(Funx.Ord.ord_t()) :: Funx.Ord.ord_map()
Creates a new Identity value by wrapping a given value.
Examples
iex> Funx.Monad.Identity.pure(5)
%Funx.Monad.Identity{value: 5}