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

Safe HaskellSafe
LanguageHaskell2010

Control.Functor.Covariant.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

Instances
Distributive Identity Source # 
Instance details

Defined in Data.Functor.Identity

Methods

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

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

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

Distributive t => Distributive (Yoneda t) Source # 
Instance details

Defined in Data.Functor.Yoneda

Methods

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

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

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