class (Extend w) <= Comonad w where
Comonad extends the
Extend class with the
which extracts a value, discarding the comonadic context.
Comonad is the dual of
extract is the dual of
- Left Identity:
extract <<= xs = xs
- Right Identity:
extract (f <<= xs) = f xs
extract :: forall a. w a -> a
Re-exports from Control.
class (Functor w) <= Extend w where
Extend class defines the extension operator
which extends a local context-dependent computation to
a global computation.
Extend is the dual of
(<<=) is the dual of
extend f <<< extend g = extend (f <<< extend g)
extend :: forall b a. (w a -> b) -> w a -> w b
Operator alias for Control.Extend.composeCoKleisliFlipped (right-associative / precedence 1)
Re-exports from Data.
class Functor f where
Functor is a type constructor which supports a mapping operation
map can be used to turn functions
a -> b into functions
f a -> f b whose argument and return types use the type constructor
to represent some computational context.
Instances must satisfy the following laws:
map identity = identity
map (f <<< g) = map f <<< map g
map :: forall a b. (a -> b) -> f a -> f b
void :: forall f a. Functor f => f a -> f Unit
void function is used to ignore the type wrapped by a
Functor, replacing it with
Unit and keeping only the type
information provided by the type constructor itself.
void is often useful when using
do notation to change the return type
of a monadic computation:
main = forE 1 10 \n -> void do print n print (n * n)