| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Profunctor.Instance.Coproduct
Description
Documentation
data ((p :: j +-> k) :+: (q :: j +-> k)) (a :: k) (b :: j) where Source Github #
Constructors
| InjL :: forall {j} {k} (p :: j +-> k) (a :: k) (b :: j) (q :: j +-> k). p a b -> (p :+: q) a b | |
| InjR :: forall {j} {k} (q :: j +-> k) (a :: k) (b :: j) (p :: j +-> k). q a b -> (p :+: q) a b |
Instances
| (Strong t p, Strong t q) => Strong (t :: (m, j) +-> j) (p :+: q :: j -> j -> Type) Source Github # | |
| (Finitary p, Finitary q) => Finitary (p :+: q :: k -> j -> Type) Source Github # | The indices of |
Defined in Proarrow.Category.Enriched.Finitary Methods size :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural Source Github # toIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => (p :+: q) a b -> Natural Source Github # fromIndex :: forall (a :: k) (b :: j). (Ob a, Ob b) => Natural -> (p :+: q) a b Source Github # elements :: forall (a :: k) (b :: j). (Ob a, Ob b) => [(p :+: q) a b] Source Github # | |
| (Profunctor p, Profunctor q) => Profunctor (p :+: q :: k -> j -> Type) Source Github # | |
Defined in Proarrow.Profunctor.Instance.Coproduct Methods dimap :: forall (c :: k) (a :: k) (b :: j) (d :: j). (c ~> a) -> (b ~> d) -> (p :+: q) a b -> (p :+: q) c d Source Github # lmap :: forall (c :: k) (a :: k) (b :: j). (c ~> a) -> (p :+: q) a b -> (p :+: q) c b Source Github # rmap :: forall (b :: j) (d :: j) (a :: k). (b ~> d) -> (p :+: q) a b -> (p :+: q) a d Source Github # (\\) :: forall (a :: k) (b :: j) r. ((Ob a, Ob b) => r) -> (p :+: q) a b -> r Source Github # | |
| (DaggerProfunctor p, DaggerProfunctor q) => DaggerProfunctor (p :+: q :: k -> k -> Type) Source Github # | |
| (Cotraversable p, Cotraversable q) => Cotraversable (p :+: q :: k -> k -> Type) Source Github # | |
Defined in Proarrow.Category.Monoidal.Distributive | |
| (Traversable p, Traversable q) => Traversable (p :+: q :: k -> k -> Type) Source Github # | |
| Profunctor p => Functor ((:+:) p :: (j +-> k) -> k -> j -> Type) Source Github # | |
| Profunctor p => Promonad (Star ((:+:) p) :: (k -> j -> Type) -> (j +-> k) -> Type) Source Github # | |
coproduct :: forall {k} {j} p (x :: k) (y :: j) r q. (p x y -> r) -> (q x y -> r) -> (p :+: q) x y -> r Source Github #
type Sum (f :: j +-> k) (g :: j +-> k) = CorepStar (RepCostar f :*: RepCostar g) Source Github #
The pointwise coproduct of represented functors, with object action
Sum f g % b = (f % b) || (g % b). It is representable when f and g
are representable and their target category has binary coproducts; the
required instance is supplied by Proarrow.Colimit.BinaryCoproduct.
Whereas (f :+: g) a b chooses between arrows into the two summands,
Sum f g a b represents an arrow into their coproduct. In Type these
are Either (a -> f % b) (a -> g % b) and a -> Either (f % b) (g % b).