Skip to main content

Module extend

Module extend 

Source
Expand description

Cooperative extension of a local context-dependent computation to a global computation.

Extend is the dual of Semimonad: where bind sequences computations by extracting a value and feeding it to a function that produces a new context, extend takes a function that consumes a whole context and lifts it to operate within the context. In categorical terms, extend is co-Kleisli extension.

This module is a port of PureScript’s Control.Extend.

Traits§

Extend
A type class for types that support co-Kleisli extension.

Functions§

compose_co_kleisli
Forwards co-Kleisli composition.
compose_co_kleisli_flipped
Backwards co-Kleisli composition.
duplicate
Duplicates a comonadic context, wrapping it inside another layer of the same context.
extend
Extends a local context-dependent computation to a global computation.
extend_flipped
Extends with the arguments flipped.