A dual of Monad, the framework of computing neighbor states in parallel.
All instances of the comonad c must satisfy the following laws:
c
x
c.extract(c.duplicate(x))
c.map(c.extract)(c.duplicate(x))
c.duplicate(c.duplicate(x))
c.map(c.duplicate)(c.duplicate(x))
Readonly
Computes the surrounding states from a source object wa.
wa
Extracts the internal state of type A.
A
A dual of Monad, the framework of computing neighbor states in parallel.
All instances of the comonad
cmust satisfy the following laws:x;c.extract(c.duplicate(x))equals tox,x;c.map(c.extract)(c.duplicate(x))equals tox,x;c.duplicate(c.duplicate(x))equals toc.map(c.duplicate)(c.duplicate(x)).