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

  • F

  • W

Hierarchy

Properties

duplicate: (<A>(wa) => Instance<Apply1<W, Instance<Apply1<W, A>>>>)

Type declaration

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

Type declaration

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

      Type Parameters

      • A

      Parameters

      Returns A

      The value of type A.

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

Type declaration

unwrap: (<A>(wa) => Get1<F, Get1<W, A>>)

Type declaration

Generated using TypeDoc