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

  • P

Hierarchy

Properties

coindex: (<A, B>(pab) => ((corep) => B))

Type declaration

    • <A, B>(pab): ((corep) => B)
    • Type Parameters

      • A

      • B

      Parameters

      Returns ((corep) => B)

cotabulate: (<A, B>(f) => Instance<Apply2<P, B, A>>)

Type declaration

diMap: (<A, B>(f) => (<C, D>(g) => ((m) => Instance<Apply2<P, D, A>>)))

Type declaration

distribute: (<F>(f) => (<A, B>(pab) => Get2<P, Get1<F, A>, Get1<F, B>>))

Type declaration

duplicate: (<A>(wa) => Instance<Apply1<Corep<P>, Instance<Apply1<Corep<P>, 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<Corep<P>>
left: (<A, B, C>(curr) => Instance<Apply2<P, Result<B, C>, Result<A, C>>>)

Type declaration

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

Type declaration

    • <T, U>(fn): ((t) => Instance<Apply1<Corep<P>, U>>)
    • Maps the function fn onto F structure.

      Type Parameters

      • T

      • U

      Parameters

      • fn: ((t) => U)

        The function to be mapped.

          • (t): U
          • Parameters

            • t: T

            Returns U

      Returns ((t) => Instance<Apply1<Corep<P>, U>>)

      The mapped function.

right: (<A, B, C>(curr) => Instance<Apply2<P, Result<C, B>, Result<C, A>>>)

Type declaration

Generated using TypeDoc