Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Identity<A>

A simple wrapper around a value which provides no special behavior.

Identity is valuable in cases where some function expects an instance of Functor, Monad, or otherwise, but the data to pass needs no special behavior (as may be provided by something like Maybe).

category

Identity

Type parameters

  • A

Hierarchy

  • Identity

Implements

Index

Constructors

Properties

Methods

Constructors

Private constructor

Properties

value

value: A

A value of any type to wrap in Identity

Methods

ap

  • Apply a function wrapped in Identity to the value wrapped by this Identity.

    Type parameters

    • B

    Parameters

    • fab: Identity<function>

      An Identity wrapping a unary function.

    Returns Identity<B>

chain

  • A monadic bind. Apply a function which returns an Identity without adding additional structure.

    Type parameters

    • B

    Parameters

    • fa: function

      A function which returns an Identity.

    Returns Identity<B>

map

  • Apply a function to the value wrapped by Identity.

    Type parameters

    • B

    Parameters

    • f: function

      A unary function.

        • (a: A): B
        • Parameters

          • a: A

          Returns B

    Returns Identity<B>

toString

  • toString(): String

Static of

Static pure

Generated using TypeDoc