Safe Haskell | None |
---|---|
Language | Haskell2010 |
A box is something that commits and emits
Documentation
A Box is a product of a Committer m and an Emitter. Think of a box with an incoming wire and an outgoing wire. Now notice that the abstraction is reversable: are you looking at two wires from "inside a box"; a blind erlang grunt communicating with the outside world via the two thin wires, or are you looking from "outside the box"; interacting with a black box object. Either way, it's a box. And either way, the committer is contravariant and the emitter covariant so it forms a profunctor.
a Box can also be seen as having an input tape and output tape, thus available for turing and finite-state machine metaphorics.