tur/comonad

stdlib/comonad.tur
definstance

Comonad[identity]

(definstance Comonad [identity])

Comonad instance for the Identity comonad.

definstance

Comonad[pair]

(definstance Comonad [pair])

Comonad instance for the Pair (product) comonad.

Internal definitions
__identity_new-- allocate a new Identity comonad cell wrapping x.
__identity_get-- read the value stored in an Identity comonad cell.
__identity_extract-- extract the value from an Identity comonad cell.
__identity_extend-- apply fn to the Identity cell and wrap the result.
__identity_duplicate-- wrap an Identity cell inside another Identity cell.
__pair_new-- allocate a new Pair comonad cell with environment and value.
__pair_env-- read the environment component of a Pair comonad cell.
__pair_val-- read the value component of a Pair comonad cell.
__pair_extract-- extract the value from a Pair comonad cell.
__pair_extend-- extend over a Pair cell: (e, a) -> (e, f (e, a)).
__pair_duplicate-- duplicate a Pair cell: (e, a) -> (e, (e, a)).