pandora-0.1.2: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.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 Pandora.Paradigm.Basis.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 (Jack t) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Jack

Methods

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

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

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

(Distributive (t u), Distributive u) => Distributive (Y t u) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Transformer

Methods

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

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

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

(Distributive t, Distributive u) => Distributive (T t u) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Transformer

Methods

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

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

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

(Distributive t, Distributive u) => Distributive (U Co Co t u) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Composition

Methods

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

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

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

(Distributive t, Distributive u, Distributive v) => Distributive (UU Co Co Co t u v) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Composition

Methods

(>>-) :: Covariant t0 => t0 a -> (a -> UU Co Co Co t u v b) -> (UU Co Co Co t u v :.: t0) b Source #

collect :: Covariant t0 => (a -> UU Co Co Co t u v b) -> t0 a -> (UU Co Co Co t u v :.: t0) b Source #

distribute :: Covariant t0 => (t0 :.: UU Co Co Co t u v) a -> (UU Co Co Co t u v :.: t0) a Source #

(Distributive t, Distributive u, Distributive v, Distributive w) => Distributive (UUU Co Co Co Co t u v w) Source # 
Instance details

Defined in Pandora.Paradigm.Junction.Composition

Methods

(>>-) :: Covariant t0 => t0 a -> (a -> UUU Co Co Co Co t u v w b) -> (UUU Co Co Co Co t u v w :.: t0) b Source #

collect :: Covariant t0 => (a -> UUU Co Co Co Co t u v w b) -> t0 a -> (UUU Co Co Co Co t u v w :.: t0) b Source #

distribute :: Covariant t0 => (t0 :.: UUU Co Co Co Co t u v w) a -> (UUU Co Co Co Co t u v w :.: t0) a Source #