Options
All
  • Public
  • Public/Protected
  • All
Menu

Type-class laws for Monad, as defined in the funland sub-project, mirroring the static-land spec.

Monad inherits the laws of Applicative and of Chain and in addition must obey:

  1. Left identity: M.chain(f, M.of(a)) <-> f(a)
  2. Right identity: M.chain(M.of, u) <-> u
  3. Functor's map can be derived: A.map = (f, u) => A.chain(x => A.of(f(x)), u)

Type parameters

  • F

Hierarchy

Implements

Index

Constructors

constructor

Properties

F

F: Monad<F>

Methods

applicativeHomomorphism

  • applicativeHomomorphism<A, B>(a: A, f: function): Equiv<HK<F, B>>

applicativeIdentity

  • applicativeIdentity<A>(fa: HK<F, A>): Equiv<HK<F, A>>

applicativeInterchange

  • applicativeInterchange<A, B>(a: A, ff: HK<F, function>): Equiv<HK<F, B>>

applicativeMap

  • applicativeMap<A, B>(fa: HK<F, A>, f: function): Equiv<HK<F, B>>

applyComposition

  • applyComposition<A, B, C>(fa: HK<F, A>, fab: HK<F, function>, fbc: HK<F, function>): Equiv<HK<F, C>>

chainAssociativity

  • chainAssociativity<A, B, C>(fa: HK<F, A>, f: function, g: function): Equiv<HK<F, C>>
  • Type parameters

    • A

    • B

    • C

    Parameters

    • fa: HK<F, A>
    • f: function
        • (a: A): HK<F, B>
        • Parameters

          • a: A

          Returns HK<F, B>

    • g: function
        • (b: B): HK<F, C>
        • Parameters

          • b: B

          Returns HK<F, C>

    Returns Equiv<HK<F, C>>

chainConsistentApply

  • chainConsistentApply<A, B>(ff: HK<F, function>, fa: HK<F, A>): Equiv<HK<F, B>>
  • Type parameters

    • A

    • B

    Parameters

    • ff: HK<F, function>
    • fa: HK<F, A>

    Returns Equiv<HK<F, B>>

chainRecConsistency

  • chainRecConsistency<A>(a: A, f: function): Equiv<HK<F, A>>
  • Type parameters

    • A

    Parameters

    • a: A
    • f: function
        • (a: A): HK<F, A>
        • Parameters

          • a: A

          Returns HK<F, A>

    Returns Equiv<HK<F, A>>

composition

  • composition<A, B, C>(fa: HK<F, A>, f: function, g: function): Equiv<HK<F, C>>
  • Type parameters

    • A

    • B

    • C

    Parameters

    • fa: HK<F, A>
    • f: function
        • (a: B): C
        • Parameters

          • a: B

          Returns C

    • g: function
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    Returns Equiv<HK<F, C>>

identity

  • identity<A>(fa: HK<F, A>): Equiv<HK<F, A>>

monadChainRecStackSafety

  • monadChainRecStackSafety(): Equiv<HK<F, number>>

monadLeftIdentity

  • monadLeftIdentity<A, B>(a: A, f: function): Equiv<HK<F, B>>
  • Type parameters

    • A

    • B

    Parameters

    • a: A
    • f: function
        • (a: A): HK<F, B>
        • Parameters

          • a: A

          Returns HK<F, B>

    Returns Equiv<HK<F, B>>

monadMap

  • monadMap<A, B>(fa: HK<F, A>, f: function): Equiv<HK<F, B>>
  • Type parameters

    • A

    • B

    Parameters

    • fa: HK<F, A>
    • f: function
        • (a: A): B
        • Parameters

          • a: A

          Returns B

    Returns Equiv<HK<F, B>>

monadRightIdentity

  • monadRightIdentity<A, B>(fa: HK<F, A>): Equiv<HK<F, A>>
  • Type parameters

    • A

    • B

    Parameters

    • fa: HK<F, A>

    Returns Equiv<HK<F, A>>

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc