The identity data structure is quite a trivial one, working just as a wrapper around a given type.
The only constructor of Identity
is wrap
, which just wraps a value
/**
* @template A
*/
final class Identity
{
/**
* @template B
* @param B $b
* @return IO<B>
*/
public static function wrap($b): self
}
Synthetically, its type is
wrap :: B -> Identity<B>
The only eliminator for Identity
is unwrap
which just removes the Identity
layer
/**
* @return A
*/
public function unwrap()
Its simplified type is
unwrap :: Identity A -> A
The Identity
datatype actually describes the absence of effects.
IdentityApplicative
IdentityApply
IdentityFoldable
IdentityFunctor
IdentityMonad
IdentityTraversable