A comonoid in a monoidal category is a monoid in the dual category, what is the problem?
Being the dual to a monoid, it consists of:
- The dual to unit, a function from
- The dual to multiplication, a function from
It is useful within Rust's ownership type system, to represent a type that can be both cloned and destroyed.
There is a trivial implementation of this trait for every
type that implements
Clone, as reflected by the
newtype wrapper, with
The behaviour of
comult can be altered by the
The dual to the monoidal unit.
The dual to the monoidal multiplication.