proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Category.Monoidal.Distributive

Description

Distributivity of a tensor over coproducts: a Distributive category has distL/distR and absorption by the initial object, and a DistributiveProfunctor is monoidal for both tensor and coproduct. Also home to Traversable and Cotraversable profunctors, which distribute any StrongDistributiveProfunctor and underlie Traversal.

Synopsis

Documentation

class (Monoidal k, HasCoproducts k) => Distributive k where Source Github #

A distributive monoidal category: the tensor distributes over coproducts, and annihilates the InitialObject. The monoidal and coproduct worlds meet here.

Laws:

Each of the four arrows is invertible, with the named inverse:

Checked by testDistributive.

Methods

distL :: forall (a :: k) (b :: k) (c :: k). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

Distributes a tensor on the left over a coproduct.

distR :: forall (a :: k) (b :: k) (c :: k). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

Distributes a tensor on the right over a coproduct.

absorbL :: forall (a :: k). Ob a => (a ** (InitialObject :: k)) ~> (InitialObject :: k) Source Github #

The InitialObject annihilates the tensor on the right.

absorbR :: forall (a :: k). Ob a => ((InitialObject :: k) ** a) ~> (InitialObject :: k) Source Github #

The InitialObject annihilates the tensor on the left.

Instances

Instances details
Distributive BOOL Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

distL :: forall (a :: BOOL) (b :: BOOL) (c :: BOOL). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: BOOL) (b :: BOOL) (c :: BOOL). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: BOOL). Ob a => (a ** (InitialObject :: BOOL)) ~> (InitialObject :: BOOL) Source Github #

absorbR :: forall (a :: BOOL). Ob a => ((InitialObject :: BOOL) ** a) ~> (InitialObject :: BOOL) Source Github #

Distributive COST Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cost

Methods

distL :: forall (a :: COST) (b :: COST) (c :: COST). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: COST) (b :: COST) (c :: COST). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: COST). Ob a => (a ** (InitialObject :: COST)) ~> (InitialObject :: COST) Source Github #

absorbR :: forall (a :: COST). Ob a => ((InitialObject :: COST) ** a) ~> (InitialObject :: COST) Source Github #

Distributive FINHASK Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinHask

Methods

distL :: forall (a :: FINHASK) (b :: FINHASK) (c :: FINHASK). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: FINHASK) (b :: FINHASK) (c :: FINHASK). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: FINHASK). Ob a => (a ** (InitialObject :: FINHASK)) ~> (InitialObject :: FINHASK) Source Github #

absorbR :: forall (a :: FINHASK). Ob a => ((InitialObject :: FINHASK) ** a) ~> (InitialObject :: FINHASK) Source Github #

Distributive FINREL Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinRel

Methods

distL :: forall (a :: FINREL) (b :: FINREL) (c :: FINREL). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: FINREL) (b :: FINREL) (c :: FINREL). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: FINREL). Ob a => (a ** (InitialObject :: FINREL)) ~> (InitialObject :: FINREL) Source Github #

absorbR :: forall (a :: FINREL). Ob a => ((InitialObject :: FINREL) ** a) ~> (InitialObject :: FINREL) Source Github #

Distributive FINSET Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinSet

Methods

distL :: forall (a :: FINSET) (b :: FINSET) (c :: FINSET). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: FINSET) (b :: FINSET) (c :: FINSET). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: FINSET). Ob a => (a ** (InitialObject :: FINSET)) ~> (InitialObject :: FINSET) Source Github #

absorbR :: forall (a :: FINSET). Ob a => ((InitialObject :: FINSET) ** a) ~> (InitialObject :: FINSET) Source Github #

Distributive LINEAR Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Linear

Methods

distL :: forall (a :: LINEAR) (b :: LINEAR) (c :: LINEAR). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: LINEAR) (b :: LINEAR) (c :: LINEAR). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: LINEAR). Ob a => (a ** (InitialObject :: LINEAR)) ~> (InitialObject :: LINEAR) Source Github #

absorbR :: forall (a :: LINEAR). Ob a => ((InitialObject :: LINEAR) ** a) ~> (InitialObject :: LINEAR) Source Github #

Distributive () Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

distL :: forall (a :: ()) (b :: ()) (c :: ()). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: ()) (b :: ()) (c :: ()). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: ()). Ob a => (a ** (InitialObject :: ())) ~> (InitialObject :: ()) Source Github #

absorbR :: forall (a :: ()). Ob a => ((InitialObject :: ()) ** a) ~> (InitialObject :: ()) Source Github #

Distributive Type Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

distL :: (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: Ob a => (a ** (InitialObject :: Type)) ~> (InitialObject :: Type) Source Github #

absorbR :: Ob a => ((InitialObject :: Type) ** a) ~> (InitialObject :: Type) Source Github #

Num a => Distributive (MatK a) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Mat

Methods

distL :: forall (a0 :: MatK a) (b :: MatK a) (c :: MatK a). (Ob a0, Ob b, Ob c) => (a0 ** (b || c)) ~> ((a0 ** b) || (a0 ** c)) Source Github #

distR :: forall (a0 :: MatK a) (b :: MatK a) (c :: MatK a). (Ob a0, Ob b, Ob c) => ((a0 || b) ** c) ~> ((a0 ** c) || (b ** c)) Source Github #

absorbL :: forall (a0 :: MatK a). Ob a0 => (a0 ** (InitialObject :: MatK a)) ~> (InitialObject :: MatK a) Source Github #

absorbR :: forall (a0 :: MatK a). Ob a0 => ((InitialObject :: MatK a) ** a0) ~> (InitialObject :: MatK a) Source Github #

(Distributive (ORDINAL ('S n)), MonoidalOrdinal ('S n)) => Distributive (ORDINAL ('S ('S n))) Source Github #

A chain is a distributive lattice: the meet is the minimum and the join the maximum. By recursion on the objects, as the products and coproducts are. A bottom on either side makes both sides the same object, and otherwise both sides are a successor.

Instance details

Defined in Proarrow.Category.Instance.Ordinal

Methods

distL :: forall (a :: ORDINAL ('S ('S n))) (b :: ORDINAL ('S ('S n))) (c :: ORDINAL ('S ('S n))). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: ORDINAL ('S ('S n))) (b :: ORDINAL ('S ('S n))) (c :: ORDINAL ('S ('S n))). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: ORDINAL ('S ('S n))). Ob a => (a ** (InitialObject :: ORDINAL ('S ('S n)))) ~> (InitialObject :: ORDINAL ('S ('S n))) Source Github #

absorbR :: forall (a :: ORDINAL ('S ('S n))). Ob a => ((InitialObject :: ORDINAL ('S ('S n))) ** a) ~> (InitialObject :: ORDINAL ('S ('S n))) Source Github #

Distributive (ORDINAL ('S 'Z)) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Ordinal

Methods

distL :: forall (a :: ORDINAL ('S 'Z)) (b :: ORDINAL ('S 'Z)) (c :: ORDINAL ('S 'Z)). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: ORDINAL ('S 'Z)) (b :: ORDINAL ('S 'Z)) (c :: ORDINAL ('S 'Z)). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: ORDINAL ('S 'Z)). Ob a => (a ** (InitialObject :: ORDINAL ('S 'Z))) ~> (InitialObject :: ORDINAL ('S 'Z)) Source Github #

absorbR :: forall (a :: ORDINAL ('S 'Z)). Ob a => ((InitialObject :: ORDINAL ('S 'Z)) ** a) ~> (InitialObject :: ORDINAL ('S 'Z)) Source Github #

BiCCC k => Distributive (PROD k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Cartesian

Methods

distL :: forall (a :: PROD k) (b :: PROD k) (c :: PROD k). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: PROD k) (b :: PROD k) (c :: PROD k). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: PROD k). Ob a => (a ** (InitialObject :: PROD k)) ~> (InitialObject :: PROD k) Source Github #

absorbR :: forall (a :: PROD k). Ob a => ((InitialObject :: PROD k) ** a) ~> (InitialObject :: PROD k) Source Github #

(Distributive k, Monad p, DistributiveProfunctor p) => Distributive (KLEISLI p) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

distL :: forall (a :: KLEISLI p) (b :: KLEISLI p) (c :: KLEISLI p). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: KLEISLI p) (b :: KLEISLI p) (c :: KLEISLI p). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: KLEISLI p). Ob a => (a ** (InitialObject :: KLEISLI p)) ~> (InitialObject :: KLEISLI p) Source Github #

absorbR :: forall (a :: KLEISLI p). Ob a => ((InitialObject :: KLEISLI p) ** a) ~> (InitialObject :: KLEISLI p) Source Github #

(Monoidal j, Monoidal k) => Distributive (j +-> k) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Day

Methods

distL :: forall (a :: j +-> k) (b :: j +-> k) (c :: j +-> k). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: j +-> k) (b :: j +-> k) (c :: j +-> k). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: j +-> k). Ob a => (a ** (InitialObject :: j +-> k)) ~> (InitialObject :: j +-> k) Source Github #

absorbR :: forall (a :: j +-> k). Ob a => ((InitialObject :: j +-> k) ** a) ~> (InitialObject :: j +-> k) Source Github #

(Distributive j, Distributive k) => Distributive (j, k) Source Github #

A product of distributive categories distributes componentwise.

Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

distL :: forall (a :: (j, k)) (b :: (j, k)) (c :: (j, k)). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: (j, k)) (b :: (j, k)) (c :: (j, k)). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: (j, k)). Ob a => (a ** (InitialObject :: (j, k))) ~> (InitialObject :: (j, k)) Source Github #

absorbR :: forall (a :: (j, k)). Ob a => ((InitialObject :: (j, k)) ** a) ~> (InitialObject :: (j, k)) Source Github #

Elems DistributiveStructures cs => Distributive (FREE cs p) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

distL :: forall (a :: FREE cs p) (b :: FREE cs p) (c :: FREE cs p). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distR :: forall (a :: FREE cs p) (b :: FREE cs p) (c :: FREE cs p). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

absorbL :: forall (a :: FREE cs p). Ob a => (a ** (InitialObject :: FREE cs p)) ~> (InitialObject :: FREE cs p) Source Github #

absorbR :: forall (a :: FREE cs p). Ob a => ((InitialObject :: FREE cs p) ** a) ~> (InitialObject :: FREE cs p) Source Github #

type DistributiveStructures = '[Monoidal, HasInitialObject, HasBinaryCoproducts, Distributive] Source Github #

The structures the free category needs for Distributive, and those its laws are stated for.

distLInv :: forall {k} (a :: k) (b :: k) (c :: k). (Distributive k, Ob a, Ob b, Ob c) => ((a ** b) || (a ** c)) ~> (a ** (b || c)) Source Github #

distRInv :: forall {k} (a :: k) (b :: k) (c :: k). (Distributive k, Ob a, Ob b, Ob c) => ((a ** c) || (b ** c)) ~> ((a || b) ** c) Source Github #

branch :: forall {k} (a :: k) (b :: k) (c :: k) (i :: k) p. (DistributiveProfunctor p, Promonad p, Distributive k, Ob a, Ob b, Ob c) => p i (a || b) -> p a c -> p b c -> p i c Source Github #

Distributive promonads seem similar to selective applicative functors. https://blog.veritates.love/selective_applicatives_theoretical_basis.html

distLClosed :: forall {k} (a :: k) (b :: k) (c :: k). (Closed k, SymMonoidal k, HasBinaryCoproducts k, Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github #

distRClosed :: forall {k} (a :: k) (b :: k) (c :: k). (Closed k, HasBinaryCoproducts k, Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github #

class (DistributiveProfunctor p, MonStrong p, Strong (CoprodAction :: k -> (COPROD k, k) -> Type) p) => StrongDistributiveProfunctor (p :: k +-> k) Source Github #

Instances

Instances details
(DistributiveProfunctor p, MonStrong p, Strong (CoprodAction :: k -> (COPROD k, k) -> Type) p) => StrongDistributiveProfunctor (p :: k +-> k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

class Profunctor t => Traversable (t :: k +-> k) where Source Github #

Methods

traverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (t :.: p) :~> (p :.: t) Source Github #

Instances

Instances details
CategoryOf k => Traversable (Id :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

traverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => ((Id :: k -> k -> Type) :.: p) :~> (p :.: (Id :: k -> k -> Type)) Source Github #

Traversable (->) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

traverse :: forall (p :: Type +-> Type). StrongDistributiveProfunctor p => ((->) :.: p) :~> (p :.: (->)) Source Github #

(Monoidal k, SNatI n) => Traversable (Pow n :: k -> k -> Type) Source Github #

A tensor power is a fixed-shape traversable: distribute the carrier over the n copies.

Instance details

Defined in Proarrow.Optic.PowerGrate

Methods

traverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => ((Pow n :: k -> k -> Type) :.: p) :~> (p :.: (Pow n :: k -> k -> Type)) Source Github #

Traversable p => Traversable (Fix p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Fix

Methods

traverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => (Fix p :.: p0) :~> (p0 :.: Fix p) Source Github #

(Monoid w, Monoidal k) => Traversable (Writer w :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Writer

Methods

traverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (Writer w :.: p) :~> (p :.: Writer w) Source Github #

Traversable (Star Maybe) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Star

Traversable (Star []) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Star

Monoidal k => Traversable (HaskValue c :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.HaskValue

Methods

traverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => ((HaskValue c :: k -> k -> Type) :.: p) :~> (p :.: (HaskValue c :: k -> k -> Type)) Source Github #

(Traversable p, Monoid w) => Traversable (WriterT w p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Writer

Methods

traverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => (WriterT w p :.: p0) :~> (p0 :.: WriterT w p) Source Github #

(Traversable p, Traversable q) => Traversable (p :+: q :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

traverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => ((p :+: q) :.: p0) :~> (p0 :.: (p :+: q)) Source Github #

(Cartesian k, Traversable p, Traversable q) => Traversable (p :*: q :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Cartesian

Methods

traverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => ((p :*: q) :.: p0) :~> (p0 :.: (p :*: q)) Source Github #

(Traversable p, Traversable q) => Traversable (p :.: q :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

traverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => ((p :.: q) :.: p0) :~> (p0 :.: (p :.: q)) Source Github #

repTraverse :: forall {k} (t :: k +-> k) p (a :: k) (b :: k). (Traversable t, Representable t, StrongDistributiveProfunctor p) => p a b -> p (t % a) (t % b) Source Github #

With a representable traversable profunctor, you get a traversal a la one-liner.

baseTraverse :: forall {k} (t :: k +-> k) (f :: k +-> k) (a :: k) (b :: k). (Traversable t, Representable t, Representable f, StrongDistributiveProfunctor f, Ob b) => (a ~> (f % b)) -> (t % a) ~> (f % (t % b)) Source Github #

If both profunctors are representable, you get traversals as in base.

class Profunctor t => Cotraversable (t :: k +-> k) where Source Github #

Methods

cotraverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (p :.: t) :~> (t :.: p) Source Github #

Instances

Instances details
CategoryOf k => Cotraversable (Id :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

cotraverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (p :.: (Id :: k -> k -> Type)) :~> ((Id :: k -> k -> Type) :.: p) Source Github #

Cotraversable (->) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

cotraverse :: forall (p :: Type +-> Type). StrongDistributiveProfunctor p => (p :.: (->)) :~> ((->) :.: p) Source Github #

Cotraversable p => Cotraversable (Fix p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Fix

Methods

cotraverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => (p0 :.: Fix p) :~> (Fix p :.: p0) Source Github #

(Comonoid r, Monoidal k) => Cotraversable (Reader ('OP r) :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Reader

Methods

cotraverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (p :.: Reader ('OP r)) :~> (Reader ('OP r) :.: p) Source Github #

(Functor t, Traversable (Star t)) => Cotraversable (Costar t :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Costar

Methods

cotraverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (p :.: Costar t) :~> (Costar t :.: p) Source Github #

Monoidal k => Cotraversable (HaskValue c :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.HaskValue

Methods

cotraverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (p :.: (HaskValue c :: k -> k -> Type)) :~> ((HaskValue c :: k -> k -> Type) :.: p) Source Github #

(Traversable t, Representable t) => Cotraversable (RepCostar t :: k -> k -> Type) Source Github #

This breaks for possibly infinite traversals like Star [].

Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

cotraverse :: forall (p :: k +-> k). StrongDistributiveProfunctor p => (p :.: RepCostar t) :~> (RepCostar t :.: p) Source Github #

(Cotraversable p, Comonoid r, Monoidal k) => Cotraversable (ReaderT ('OP r) p :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Promonad.Reader

Methods

cotraverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => (p0 :.: ReaderT ('OP r) p) :~> (ReaderT ('OP r) p :.: p0) Source Github #

(Cotraversable p, Cotraversable q) => Cotraversable (p :+: q :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

cotraverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => (p0 :.: (p :+: q)) :~> ((p :+: q) :.: p0) Source Github #

(HasBinaryCoproducts k, Cotraversable p, Cotraversable q) => Cotraversable (p :*: q :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

cotraverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => (p0 :.: (p :*: q)) :~> ((p :*: q) :.: p0) Source Github #

(Cotraversable p, Cotraversable q) => Cotraversable (p :.: q :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Distributive

Methods

cotraverse :: forall (p0 :: k +-> k). StrongDistributiveProfunctor p0 => (p0 :.: (p :.: q)) :~> ((p :.: q) :.: p0) Source Github #

corepTraverse :: forall {k} (t :: k +-> k) p (a :: k) (b :: k). (Cotraversable t, Corepresentable t, StrongDistributiveProfunctor p) => p a b -> p (t %% a) (t %% b) Source Github #

With a corepresentable cotraversable profunctor, you get a co-traversal a la one-liner.

Orphan instances

(CopyDiscard k, HasCoproducts k, Monoid r) => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (Rep (Constant r) :: k -> k -> Type) Source Github #

The constant functor absorbs a coproduct action: the injected summand is discarded onto the monoid's unit, so this needs only copying/discarding on the tensor side and coproducts.

Instance details

Methods

act :: forall (a :: COPROD k) (x :: k) (y :: k). Ob a => Rep (Constant r) x y -> Rep (Constant r) (Act (CoprodAction :: k -> (COPROD k, k) -> Type) a x) (Act (CoprodAction :: k -> (COPROD k, k) -> Type) a y) Source Github #