A single cartesian-closed adjunction spins off the whole zoo of “value plus context” effects. Fix an object of positions, and Writer, Reader, State, and Store each become a way of packaging with a payload.

In a cartesian closed category the currying adjunction is the generator, with the product left adjoint to the internal hom. Its monad/comonad pair and their composites give four canonical structures on :

The Writer comonad carries a logged value; the Reader monad is a value awaiting an environment; the State monad threads a mutable ; and the Store or Costate comonad pairs a current position with a way of reading off every position. Store is the comonad whose coalgebras are the natural home of accessors.

Remark on the slice reading

Writer and Reader are the two adjoints to the base-change packaged as endofunctors, where pulls back over . Here is the dependent sum and left adjoint, whereas is the dependent product and right adjoint. A value in context is thus literally an object of the slice , and the two effects are its sum and its product over .