Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class Covariant u => Distributive u where
- (>>-) :: Covariant t => t a -> (a -> u b) -> (u :.: t) >< b
- collect :: Covariant t => (a -> u b) -> t a -> (u :.: t) >< b
- distribute :: Covariant t => ((t :.: u) >< a) -> (u :.: t) >< a
- (>>>-) :: (Covariant t, Covariant v) => ((t :.: v) >< a) -> (a -> u b) -> (u :.: (t :.: v)) >< b
- (>>>>-) :: (Covariant t, Covariant v, Covariant w) => ((t :.: (v :.: w)) >< a) -> (a -> u b) -> (u :.: (t :.: (v :.: w))) >< b
- (>>>>>-) :: (Covariant t, Covariant v, Covariant w, Covariant j) => ((t :.: (v :.: (w :.: j))) >< a) -> (a -> u b) -> (u :.: (t :.: (v :.: (w :.: j)))) >< b
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
(>>-) :: Covariant t => t a -> (a -> u b) -> (u :.: t) >< b infixl 5 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
(>>>-) :: (Covariant t, Covariant v) => ((t :.: v) >< a) -> (a -> u b) -> (u :.: (t :.: v)) >< b infixl 5 Source #
Infix versions of collect
with various nesting levels
(>>>>-) :: (Covariant t, Covariant v, Covariant w) => ((t :.: (v :.: w)) >< a) -> (a -> u b) -> (u :.: (t :.: (v :.: w))) >< b infixl 5 Source #
(>>>>>-) :: (Covariant t, Covariant v, Covariant w, Covariant j) => ((t :.: (v :.: (w :.: j))) >< a) -> (a -> u b) -> (u :.: (t :.: (v :.: (w :.: j)))) >< b infixl 5 Source #
Instances
Distributive Identity Source # | |
Defined in Pandora.Paradigm.Basis.Identity (>>-) :: 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 # (>>>-) :: (Covariant t, Covariant v) => ((t :.: v) >< a) -> (a -> Identity b) -> (Identity :.: (t :.: v)) >< b Source # (>>>>-) :: (Covariant t, Covariant v, Covariant w) => ((t :.: (v :.: w)) >< a) -> (a -> Identity b) -> (Identity :.: (t :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t, Covariant v, Covariant w, Covariant j) => ((t :.: (v :.: (w :.: j))) >< a) -> (a -> Identity b) -> (Identity :.: (t :.: (v :.: (w :.: j)))) >< b Source # | |
Distributive (Proxy :: Type -> Type) Source # | |
Defined in Pandora.Paradigm.Basis.Proxy (>>-) :: Covariant t => t a -> (a -> Proxy b) -> (Proxy :.: t) >< b Source # collect :: Covariant t => (a -> Proxy b) -> t a -> (Proxy :.: t) >< b Source # distribute :: Covariant t => ((t :.: Proxy) >< a) -> (Proxy :.: t) >< a Source # (>>>-) :: (Covariant t, Covariant v) => ((t :.: v) >< a) -> (a -> Proxy b) -> (Proxy :.: (t :.: v)) >< b Source # (>>>>-) :: (Covariant t, Covariant v, Covariant w) => ((t :.: (v :.: w)) >< a) -> (a -> Proxy b) -> (Proxy :.: (t :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t, Covariant v, Covariant w, Covariant j) => ((t :.: (v :.: (w :.: j))) >< a) -> (a -> Proxy b) -> (Proxy :.: (t :.: (v :.: (w :.: j)))) >< b Source # | |
Distributive t => Distributive (Jack t) Source # | |
Defined in Pandora.Paradigm.Basis.Jack (>>-) :: 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 # (>>>-) :: (Covariant t0, Covariant v) => ((t0 :.: v) >< a) -> (a -> Jack t b) -> (Jack t :.: (t0 :.: v)) >< b Source # (>>>>-) :: (Covariant t0, Covariant v, Covariant w) => ((t0 :.: (v :.: w)) >< a) -> (a -> Jack t b) -> (Jack t :.: (t0 :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t0, Covariant v, Covariant w, Covariant j) => ((t0 :.: (v :.: (w :.: j))) >< a) -> (a -> Jack t b) -> (Jack t :.: (t0 :.: (v :.: (w :.: j)))) >< b Source # | |
Distributive (Tagged tag) Source # | |
Defined in Pandora.Paradigm.Basis.Tagged (>>-) :: Covariant t => t a -> (a -> Tagged tag b) -> (Tagged tag :.: t) >< b Source # collect :: Covariant t => (a -> Tagged tag b) -> t a -> (Tagged tag :.: t) >< b Source # distribute :: Covariant t => ((t :.: Tagged tag) >< a) -> (Tagged tag :.: t) >< a Source # (>>>-) :: (Covariant t, Covariant v) => ((t :.: v) >< a) -> (a -> Tagged tag b) -> (Tagged tag :.: (t :.: v)) >< b Source # (>>>>-) :: (Covariant t, Covariant v, Covariant w) => ((t :.: (v :.: w)) >< a) -> (a -> Tagged tag b) -> (Tagged tag :.: (t :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t, Covariant v, Covariant w, Covariant j) => ((t :.: (v :.: (w :.: j))) >< a) -> (a -> Tagged tag b) -> (Tagged tag :.: (t :.: (v :.: (w :.: j)))) >< b Source # | |
Distributive ((->) e :: Type -> Type) Source # | |
Defined in Pandora.Pattern.Functor.Distributive (>>-) :: Covariant t => t a -> (a -> e -> b) -> ((->) e :.: t) >< b Source # collect :: Covariant t => (a -> e -> b) -> t a -> ((->) e :.: t) >< b Source # distribute :: Covariant t => ((t :.: (->) e) >< a) -> ((->) e :.: t) >< a Source # (>>>-) :: (Covariant t, Covariant v) => ((t :.: v) >< a) -> (a -> e -> b) -> ((->) e :.: (t :.: v)) >< b Source # (>>>>-) :: (Covariant t, Covariant v, Covariant w) => ((t :.: (v :.: w)) >< a) -> (a -> e -> b) -> ((->) e :.: (t :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t, Covariant v, Covariant w, Covariant j) => ((t :.: (v :.: (w :.: j))) >< a) -> (a -> e -> b) -> ((->) e :.: (t :.: (v :.: (w :.: j)))) >< b Source # | |
(Distributive t, Distributive u) => Distributive (TU Co Co t u) Source # | |
Defined in Pandora.Pattern.Junction.Schemes.TU (>>-) :: Covariant t0 => t0 a -> (a -> TU Co Co t u b) -> (TU Co Co t u :.: t0) >< b Source # collect :: Covariant t0 => (a -> TU Co Co t u b) -> t0 a -> (TU Co Co t u :.: t0) >< b Source # distribute :: Covariant t0 => ((t0 :.: TU Co Co t u) >< a) -> (TU Co Co t u :.: t0) >< a Source # (>>>-) :: (Covariant t0, Covariant v) => ((t0 :.: v) >< a) -> (a -> TU Co Co t u b) -> (TU Co Co t u :.: (t0 :.: v)) >< b Source # (>>>>-) :: (Covariant t0, Covariant v, Covariant w) => ((t0 :.: (v :.: w)) >< a) -> (a -> TU Co Co t u b) -> (TU Co Co t u :.: (t0 :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t0, Covariant v, Covariant w, Covariant j) => ((t0 :.: (v :.: (w :.: j))) >< a) -> (a -> TU Co Co t u b) -> (TU Co Co t u :.: (t0 :.: (v :.: (w :.: j)))) >< b Source # | |
(Distributive (t u), Distributive u) => Distributive (UTU Co Co t u) Source # | |
Defined in Pandora.Pattern.Junction.Schemes.UTU (>>-) :: Covariant t0 => t0 a -> (a -> UTU Co Co t u b) -> (UTU Co Co t u :.: t0) >< b Source # collect :: Covariant t0 => (a -> UTU Co Co t u b) -> t0 a -> (UTU Co Co t u :.: t0) >< b Source # distribute :: Covariant t0 => ((t0 :.: UTU Co Co t u) >< a) -> (UTU Co Co t u :.: t0) >< a Source # (>>>-) :: (Covariant t0, Covariant v) => ((t0 :.: v) >< a) -> (a -> UTU Co Co t u b) -> (UTU Co Co t u :.: (t0 :.: v)) >< b Source # (>>>>-) :: (Covariant t0, Covariant v, Covariant w) => ((t0 :.: (v :.: w)) >< a) -> (a -> UTU Co Co t u b) -> (UTU Co Co t u :.: (t0 :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t0, Covariant v, Covariant w, Covariant j) => ((t0 :.: (v :.: (w :.: j))) >< a) -> (a -> UTU Co Co t u b) -> (UTU Co Co t u :.: (t0 :.: (v :.: (w :.: j)))) >< b Source # | |
(Distributive t, Distributive u) => Distributive (UT Co Co t u) Source # | |
Defined in Pandora.Pattern.Junction.Schemes.UT (>>-) :: Covariant t0 => t0 a -> (a -> UT Co Co t u b) -> (UT Co Co t u :.: t0) >< b Source # collect :: Covariant t0 => (a -> UT Co Co t u b) -> t0 a -> (UT Co Co t u :.: t0) >< b Source # distribute :: Covariant t0 => ((t0 :.: UT Co Co t u) >< a) -> (UT Co Co t u :.: t0) >< a Source # (>>>-) :: (Covariant t0, Covariant v) => ((t0 :.: v) >< a) -> (a -> UT Co Co t u b) -> (UT Co Co t u :.: (t0 :.: v)) >< b Source # (>>>>-) :: (Covariant t0, Covariant v, Covariant w) => ((t0 :.: (v :.: w)) >< a) -> (a -> UT Co Co t u b) -> (UT Co Co t u :.: (t0 :.: (v :.: w))) >< b Source # (>>>>>-) :: (Covariant t0, Covariant v, Covariant w, Covariant j) => ((t0 :.: (v :.: (w :.: j))) >< a) -> (a -> UT Co Co t u b) -> (UT Co Co t u :.: (t0 :.: (v :.: (w :.: j)))) >< b Source # | |
(Distributive t, Distributive u, Distributive v) => Distributive (TUV Co Co Co t u v) Source # | |
Defined in Pandora.Pattern.Junction.Schemes.TUV (>>-) :: Covariant t0 => t0 a -> (a -> TUV Co Co Co t u v b) -> (TUV Co Co Co t u v :.: t0) >< b Source # collect :: Covariant t0 => (a -> TUV Co Co Co t u v b) -> t0 a -> (TUV Co Co Co t u v :.: t0) >< b Source # distribute :: Covariant t0 => ((t0 :.: TUV Co Co Co t u v) >< a) -> (TUV Co Co Co t u v :.: t0) >< a Source # (>>>-) :: (Covariant t0, Covariant v0) => ((t0 :.: v0) >< a) -> (a -> TUV Co Co Co t u v b) -> (TUV Co Co Co t u v :.: (t0 :.: v0)) >< b Source # (>>>>-) :: (Covariant t0, Covariant v0, Covariant w) => ((t0 :.: (v0 :.: w)) >< a) -> (a -> TUV Co Co Co t u v b) -> (TUV Co Co Co t u v :.: (t0 :.: (v0 :.: w))) >< b Source # (>>>>>-) :: (Covariant t0, Covariant v0, Covariant w, Covariant j) => ((t0 :.: (v0 :.: (w :.: j))) >< a) -> (a -> TUV Co Co Co t u v b) -> (TUV Co Co Co t u v :.: (t0 :.: (v0 :.: (w :.: j)))) >< b Source # | |
(Distributive t, Distributive u, Distributive v, Distributive w) => Distributive (TUVW Co Co Co Co t u v w) Source # | |
Defined in Pandora.Pattern.Junction.Schemes.TUVW (>>-) :: Covariant t0 => t0 a -> (a -> TUVW Co Co Co Co t u v w b) -> (TUVW Co Co Co Co t u v w :.: t0) >< b Source # collect :: Covariant t0 => (a -> TUVW Co Co Co Co t u v w b) -> t0 a -> (TUVW Co Co Co Co t u v w :.: t0) >< b Source # distribute :: Covariant t0 => ((t0 :.: TUVW Co Co Co Co t u v w) >< a) -> (TUVW Co Co Co Co t u v w :.: t0) >< a Source # (>>>-) :: (Covariant t0, Covariant v0) => ((t0 :.: v0) >< a) -> (a -> TUVW Co Co Co Co t u v w b) -> (TUVW Co Co Co Co t u v w :.: (t0 :.: v0)) >< b Source # (>>>>-) :: (Covariant t0, Covariant v0, Covariant w0) => ((t0 :.: (v0 :.: w0)) >< a) -> (a -> TUVW Co Co Co Co t u v w b) -> (TUVW Co Co Co Co t u v w :.: (t0 :.: (v0 :.: w0))) >< b Source # (>>>>>-) :: (Covariant t0, Covariant v0, Covariant w0, Covariant j) => ((t0 :.: (v0 :.: (w0 :.: j))) >< a) -> (a -> TUVW Co Co Co Co t u v w b) -> (TUVW Co Co Co Co t u v w :.: (t0 :.: (v0 :.: (w0 :.: j)))) >< b Source # |