A dual of Monad, the framework of computing neighbor states in parallel.

All instances of the comonad c must satisfy the following laws:

  • Duplicate then extract: For all x; c.extract(c.duplicate(x)) equals to x,
  • Extract as identity of map: For all x; c.map(c.extract)(c.duplicate(x)) equals to x,
  • Duplicate as identity of map: For all x; c.duplicate(c.duplicate(x)) equals to c.map(c.duplicate)(c.duplicate(x)).

Type Parameters

  • W

Hierarchy

Properties

Properties

duplicate: (<A>(wa) => Get1<W, Get1<W, A>>)

Type declaration

    • <A>(wa): Get1<W, Get1<W, A>>
    • Computes the surrounding states from a source object wa.

      Type Parameters

      • A

      Parameters

      • wa: Get1<W, A>

        The wrapped object about type A.

      Returns Get1<W, Get1<W, A>>

      The surrounding states of wa.

extract: (<A>(wa) => A)

Type declaration

    • <A>(wa): A
    • Extracts the internal state of type A.

      Type Parameters

      • A

      Parameters

      • wa: Get1<W, A>

        The wrapped object about type A.

      Returns A

      The value of type A.

map: (<T, U>(fn) => ((t) => Instance<Apply1<W, U>>))

Type declaration

Generated using TypeDoc