morphisms-functors-0.1.2: Functors, theirs compositions and transformations

Safe HaskellSafe
LanguageHaskell2010

Control.Functor.Composition.Distributive

Synopsis

Documentation

class Covariant u => Distributive u where Source #

Let f :: Distributive g => (a -> g b)
When providing a new instance, you should ensure it satisfies the two laws:
* Identity morphism: distribute . distribute ≡ identity
* Interchange collection: collect f ≡ distribute . comap f

Minimal complete definition

(>>-)

Methods

(>>-) :: Covariant t => t a -> (a -> u b) -> (u :.: t) b Source #

Infix version of collect

collect :: Covariant t => (a -> u b) -> t a -> (u :.: t) b Source #

Prefix version of >>-

distribute :: Covariant t => (t :.: u) a -> (u :.: t) a Source #

The dual of sequence