Preface_stdlib.Identity
Implementation for Identity.t
.
Identity.t
is a trivial "type constructor" that allows you to lift an arbitrary value into a context. The identity can be very useful for validating implementations (by checking its laws) or for providing a fixed implementation for transformers.
The set of concrete implementations for Identity.t
.
module Functor : Preface_specs.FUNCTOR with type 'a t = 'a t
module Applicative : Preface_specs.APPLICATIVE with type 'a t = 'a t
module Selective : Preface_specs.SELECTIVE with type 'a t = 'a t
module Monad : Preface_specs.MONAD with type 'a t = 'a t
module Comonad : Preface_specs.COMONAD with type 'a t = 'a t
module Invariant : Preface_specs.INVARIANT with type 'a t = 'a t
Additional functions to facilitate practical work with Identity.t
.
val pure : 'a -> 'a t
Create a value from 'a
to 'a Identity.t
.
val extract : 'a t -> 'a
Extract the value from an Identity.t
.
val pp :
(Stdlib.Format.formatter -> 'a -> unit) ->
Stdlib.Format.formatter ->
'a t ->
unit
Formatter for pretty-printing for Identity.t
.