proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Optic.Traversal

Description

The traversal: the many-focus optic, distributing any StrongDistributiveProfunctor with product strength through the foci. This module keeps the mutually-recursive TravRes/MonTravRes flavor classes and their leaf witnesses (Traversable and Cotraversable functors, the product lens, the coproduct prism, Beside/BesideSum juxtaposition and the unit/zero witnesses); the free-profunctor apparatus lives in Proarrow.Optic.MonoidalTraversal. A traversal subtypes to Fold and Setter. Build with traversed (from a Traversable) or traversal (from the van-Laarhoven form), eliminate with traverseOf.

Synopsis

Documentation

class (SetterRes p q, FoldRes p q) => TravRes (p :: k +-> k) (q :: k +-> k) where Source Github #

Minimal complete definition

Nothing

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => p s a -> q b t -> r a b -> r s t Source Github #

Distribute a traversal-strength profunctor. Only the product-lens witness genuinely needs Strong ProdAction (to carry the residual through the categorical product); every other witness distributes a plain StrongDistributiveProfunctor and inherits travP from monTravP.

default travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (MonTravRes p q, StrongDistributiveProfunctor r) => p s a -> q b t -> r a b -> r s t Source Github #

Instances

Instances details
(Bicartesian k, Traversable t, Representable t) => TravRes (t :: k +-> k) (RepCostar t :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t0 :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => t s a -> RepCostar t b t0 -> r a b -> r s t0 Source Github #

Monoidal k => TravRes (Two :: k -> k -> Type) (CoTwo :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Kaleidoscope

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Two s a -> CoTwo b t -> r a b -> r s t Source Github #

Monoidal k => TravRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => UnitW s a -> CoUnitW b t -> r a b -> r s t Source Github #

HasInitialObject k => TravRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => ZeroW s a -> CoZeroW b t -> r a b -> r s t Source Github #

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

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Id s a -> Id b t -> r a b -> r s t Source Github #

(Monoidal k, KnownNat n) => TravRes (Pow n :: k -> k -> Type) (CoPow n :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Kaleidoscope

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Pow n s a -> CoPow n b t -> r a b -> r s t Source Github #

Comonoid m => TravRes (LensW m :: k -> k -> Type) (CoLensW m :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.MonoidalLens

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => LensW m s a -> CoLensW m b t -> r a b -> r s t Source Github #

(CopyDiscard k, Ob a) => TravRes (TensorW a :: k -> k -> Type) (CoTensorW a :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.MonoidalTraversal

Methods

travP :: forall r (s :: k) (a0 :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => TensorW a s a0 -> CoTensorW a b t -> r a0 b -> r s t Source Github #

(Bicartesian k, Cotraversable t, Corepresentable t) => TravRes (CorepStar t :: k -> k -> Type) (t :: k +-> k) Source Github #

The former cotraversal witness: a corepresentable Cotraversable functor builds s from a shape of a's. Its travP distributes an SDP exactly as the old cotravP did -- for these (representable) witnesses a cotraversal is a traversal, which is why there is no separate Cotraversal optic.

Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t0 :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => CorepStar t s a -> t b t0 -> r a b -> r s t0 Source Github #

(TravRes p1 q1, TravRes p2 q2, Monoidal k) => TravRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Beside p1 p2 s a -> CoBeside q1 q2 b t -> r a b -> r s t Source Github #

(TravRes p1 q1, TravRes p2 q2, HasBinaryCoproducts k) => TravRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> r a b -> r s t Source Github #

(CopyDiscard k, HasCoproducts k, Ob t) => TravRes (Rep (Coproduct t) :: k -> k -> Type) (Corep (Coproduct t) :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t0 :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Rep (Coproduct t) s a -> Corep (Coproduct t) b t0 -> r a b -> r s t0 Source Github #

(HasBinaryProducts k, Ob s) => TravRes (Rep (Product s) :: k -> k -> Type) (Corep (Product s) :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s0 :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Rep (Product s) s0 a -> Corep (Product s) b t -> r a b -> r s0 t Source Github #

(TravRes f g, TravRes f' g') => TravRes (f :.: f' :: i -> i -> Type) (g' :.: g :: i -> i -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: i) (a :: i) (b :: i) (t :: i). (StrongDistributiveProfunctor r, Strong (ProdAction :: i -> (PROD i, i) -> Type) r) => (f :.: f') s a -> (g' :.: g) b t -> r a b -> r s t Source Github #

class TravRes p q => MonTravRes (p :: k +-> k) (q :: k +-> k) where Source Github #

A monoidal traversal sits between Kaleidoscope and Traversal: it distributes any StrongDistributiveProfunctor without the product-strength a lens-as-traversal needs. Every traversal witness except the product lens is a monoidal traversal.

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => p s a -> q b t -> r a b -> r s t Source Github #

Instances

Instances details
(Bicartesian k, Traversable t, Representable t) => MonTravRes (t :: k +-> k) (RepCostar t :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t0 :: k). StrongDistributiveProfunctor r => t s a -> RepCostar t b t0 -> r a b -> r s t0 Source Github #

Monoidal k => MonTravRes (Two :: k -> k -> Type) (CoTwo :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Kaleidoscope

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => Two s a -> CoTwo b t -> r a b -> r s t Source Github #

Monoidal k => MonTravRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => UnitW s a -> CoUnitW b t -> r a b -> r s t Source Github #

HasInitialObject k => MonTravRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => ZeroW s a -> CoZeroW b t -> r a b -> r s t Source Github #

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

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => Id s a -> Id b t -> r a b -> r s t Source Github #

(Monoidal k, KnownNat n) => MonTravRes (Pow n :: k -> k -> Type) (CoPow n :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Kaleidoscope

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => Pow n s a -> CoPow n b t -> r a b -> r s t Source Github #

Comonoid m => MonTravRes (LensW m :: k -> k -> Type) (CoLensW m :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.MonoidalLens

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => LensW m s a -> CoLensW m b t -> r a b -> r s t Source Github #

(CopyDiscard k, Ob a) => MonTravRes (TensorW a :: k -> k -> Type) (CoTensorW a :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.MonoidalTraversal

Methods

monTravP :: forall r (s :: k) (a0 :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => TensorW a s a0 -> CoTensorW a b t -> r a0 b -> r s t Source Github #

(Bicartesian k, Cotraversable t, Corepresentable t) => MonTravRes (CorepStar t :: k -> k -> Type) (t :: k +-> k) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t0 :: k). StrongDistributiveProfunctor r => CorepStar t s a -> t b t0 -> r a b -> r s t0 Source Github #

(MonTravRes p1 q1, MonTravRes p2 q2, Monoidal k) => MonTravRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => Beside p1 p2 s a -> CoBeside q1 q2 b t -> r a b -> r s t Source Github #

(MonTravRes p1 q1, MonTravRes p2 q2, HasBinaryCoproducts k) => MonTravRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> r a b -> r s t Source Github #

(CopyDiscard k, HasCoproducts k, Ob t) => MonTravRes (Rep (Coproduct t) :: k -> k -> Type) (Corep (Coproduct t) :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t0 :: k). StrongDistributiveProfunctor r => Rep (Coproduct t) s a -> Corep (Coproduct t) b t0 -> r a b -> r s t0 Source Github #

(MonTravRes f g, MonTravRes f' g') => MonTravRes (f :.: f' :: i -> i -> Type) (g' :.: g :: i -> i -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: i) (a :: i) (b :: i) (t :: i). StrongDistributiveProfunctor r => (f :.: f') s a -> (g' :.: g) b t -> r a b -> r s t Source Github #

type Traversal (s :: k) (t :: k) (a :: k) (b :: k) = Optic (Prostrong (TravRes :: (k +-> k) -> (k +-> k) -> Constraint)) s t a b Source Github #

type Traversal' (s :: k) (a :: k) = Traversal s s a a Source Github #

traverseOf :: forall {k} (w :: FLAVOR k k) (s :: k) (t :: k) (a :: k) (b :: k) p. (Distributive k, StrongDistributiveProfunctor p, Strong (ProdAction :: k -> (PROD k, k) -> Type) p, SubFlavor w (TravRes :: (k +-> k) -> (k +-> k) -> Constraint)) => Optic (Prostrong w) s t a b -> p a b -> p s t Source Github #

Traverse: distribute any StrongDistributiveProfunctor -- not merely a Star f (the Hask van-Laarhoven shape) -- through any optic that is at least a Traversal. Works for an arbitrary profunctor carrier by handing it to travP, rather than relying on a per-carrier Prostrong w p bridge (which could only ever cover specific carrier heads).

traversed :: forall {k} (t :: k +-> k) (a :: k) (b :: k). (Bicartesian k, Traversable t, Representable t, Ob a, Ob b) => Traversal (t % a) (t % b) a b Source Github #

Build a traversal from a Traversable (representable) functor t: it focuses every element the functor holds. This is the one weak-flavor builder that is genuinely primitive -- a Traversables traversal is not reachable by convert from any single stronger optic. The witness is t itself paired with RepCostar t (see TravRes above); the two legs are the representable universal repUniv and the identity RepCostar.

The free traversal profunctor

data Beside (p1 :: k +-> k) (p2 :: k +-> k) (s :: k) (x :: k) where Source Github #

Witness pair for traversing two juxtaposed (tensored) parts in sequence, both parts focusing the same type x.

Beside and CoBeside are each one half of Day with the two foci types identified -- a one-sided Day convolution, pointwise in the shared focus. The identification is essential: a (Day p1 p2, Day q1 q2) witness pair admits no componentwise travP (that would require splitting a StrongDistributiveProfunctor value at a tensor), which is why DayRes-flavored optics focus pairs a1 ** a2 while these witnesses visit each half's foci in sequence.

Constructors

Beside :: forall {k} (s :: k) (s1 :: k) (s2 :: k) (p1 :: k +-> k) (x :: k) (p2 :: k +-> k). (s ~> (s1 ** s2)) -> p1 s1 x -> p2 s2 x -> Beside p1 p2 s x 

Instances

Instances details
(Profunctor p1, Profunctor p2, Monoidal k) => Profunctor (Beside p1 p2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> Beside p1 p2 a b -> Beside p1 p2 c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> Beside p1 p2 a b -> Beside p1 p2 c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> Beside p1 p2 a b -> Beside p1 p2 a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> Beside p1 p2 a b -> r Source Github #

(Proadjunction p1 q1, Proadjunction p2 q2, Monoidal k) => Proadjunction (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => (CoBeside q1 q2 :.: Beside p1 p2) a a Source Github #

counit :: (Beside p1 p2 :.: CoBeside q1 q2) :~> ((~>) :: CAT k) Source Github #

(FoldRes p1 q1, FoldRes p2 q2, Monoidal k) => FoldRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => Beside p1 p2 s a -> (a ~> m) -> s ~> m Source Github #

(SetterRes p1 q1, SetterRes p2 q2, Monoidal k) => SetterRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). Beside p1 p2 s a -> CoBeside q1 q2 b t -> (a ~> b) -> s ~> t Source Github #

(MonTravRes p1 q1, MonTravRes p2 q2, Monoidal k) => MonTravRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => Beside p1 p2 s a -> CoBeside q1 q2 b t -> r a b -> r s t Source Github #

(TravRes p1 q1, TravRes p2 q2, Monoidal k) => TravRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Beside p1 p2 s a -> CoBeside q1 q2 b t -> r a b -> r s t Source Github #

data CoBeside (q1 :: k +-> k) (q2 :: k +-> k) (x :: k) (t :: k) where Source Github #

The covariant half of the Beside witness pair: recomposes the two parts' targets, (t1 ** t2) ~> t.

Constructors

CoBeside :: forall {k} (q1 :: k +-> k) (x :: k) (t1 :: k) (q2 :: k +-> k) (t2 :: k) (t :: k). q1 x t1 -> q2 x t2 -> ((t1 ** t2) ~> t) -> CoBeside q1 q2 x t 

Instances

Instances details
(Profunctor q1, Profunctor q2, Monoidal k) => Profunctor (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> CoBeside q1 q2 a b -> CoBeside q1 q2 c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> CoBeside q1 q2 a b -> CoBeside q1 q2 c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> CoBeside q1 q2 a b -> CoBeside q1 q2 a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> CoBeside q1 q2 a b -> r Source Github #

(Proadjunction p1 q1, Proadjunction p2 q2, Monoidal k) => Proadjunction (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => (CoBeside q1 q2 :.: Beside p1 p2) a a Source Github #

counit :: (Beside p1 p2 :.: CoBeside q1 q2) :~> ((~>) :: CAT k) Source Github #

(FoldRes p1 q1, FoldRes p2 q2, Monoidal k) => FoldRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => Beside p1 p2 s a -> (a ~> m) -> s ~> m Source Github #

(SetterRes p1 q1, SetterRes p2 q2, Monoidal k) => SetterRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). Beside p1 p2 s a -> CoBeside q1 q2 b t -> (a ~> b) -> s ~> t Source Github #

(MonTravRes p1 q1, MonTravRes p2 q2, Monoidal k) => MonTravRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => Beside p1 p2 s a -> CoBeside q1 q2 b t -> r a b -> r s t Source Github #

(TravRes p1 q1, TravRes p2 q2, Monoidal k) => TravRes (Beside p1 p2 :: k -> k -> Type) (CoBeside q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => Beside p1 p2 s a -> CoBeside q1 q2 b t -> r a b -> r s t Source Github #

data BesideSum (p1 :: k +-> k) (p2 :: k +-> k) (s :: k) (x :: k) where Source Github #

Witness pair for traversing one of two alternative (coproduct) parts: the same one-sided Day convolution as Beside/CoBeside, but over the coproduct monoidal structure (cf. Coprod).

Constructors

BesideSum :: forall {k} (s :: k) (s1 :: k) (s2 :: k) (p1 :: k +-> k) (x :: k) (p2 :: k +-> k). (s ~> (s1 || s2)) -> p1 s1 x -> p2 s2 x -> BesideSum p1 p2 s x 

Instances

Instances details
(Profunctor p1, Profunctor p2, CategoryOf k) => Profunctor (BesideSum p1 p2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> BesideSum p1 p2 a b -> BesideSum p1 p2 c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> BesideSum p1 p2 a b -> BesideSum p1 p2 c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> BesideSum p1 p2 a b -> BesideSum p1 p2 a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> BesideSum p1 p2 a b -> r Source Github #

(Proadjunction p1 q1, Proadjunction p2 q2, HasBinaryCoproducts k) => Proadjunction (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => (CoBesideSum q1 q2 :.: BesideSum p1 p2) a a Source Github #

counit :: (BesideSum p1 p2 :.: CoBesideSum q1 q2) :~> ((~>) :: CAT k) Source Github #

(FoldRes p1 q1, FoldRes p2 q2, HasBinaryCoproducts k) => FoldRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => BesideSum p1 p2 s a -> (a ~> m) -> s ~> m Source Github #

(SetterRes p1 q1, SetterRes p2 q2, HasBinaryCoproducts k) => SetterRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> (a ~> b) -> s ~> t Source Github #

(MonTravRes p1 q1, MonTravRes p2 q2, HasBinaryCoproducts k) => MonTravRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> r a b -> r s t Source Github #

(TravRes p1 q1, TravRes p2 q2, HasBinaryCoproducts k) => TravRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> r a b -> r s t Source Github #

data CoBesideSum (q1 :: k +-> k) (q2 :: k +-> k) (x :: k) (t :: k) where Source Github #

The covariant half of the BesideSum witness pair: recomposes the branches' targets, (t1 || t2) ~> t.

Constructors

CoBesideSum :: forall {k} (q1 :: k +-> k) (x :: k) (t1 :: k) (q2 :: k +-> k) (t2 :: k) (t :: k). q1 x t1 -> q2 x t2 -> ((t1 || t2) ~> t) -> CoBesideSum q1 q2 x t 

Instances

Instances details
(Profunctor q1, Profunctor q2, CategoryOf k) => Profunctor (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> CoBesideSum q1 q2 a b -> CoBesideSum q1 q2 c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> CoBesideSum q1 q2 a b -> CoBesideSum q1 q2 c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> CoBesideSum q1 q2 a b -> CoBesideSum q1 q2 a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> CoBesideSum q1 q2 a b -> r Source Github #

(Proadjunction p1 q1, Proadjunction p2 q2, HasBinaryCoproducts k) => Proadjunction (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => (CoBesideSum q1 q2 :.: BesideSum p1 p2) a a Source Github #

counit :: (BesideSum p1 p2 :.: CoBesideSum q1 q2) :~> ((~>) :: CAT k) Source Github #

(FoldRes p1 q1, FoldRes p2 q2, HasBinaryCoproducts k) => FoldRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => BesideSum p1 p2 s a -> (a ~> m) -> s ~> m Source Github #

(SetterRes p1 q1, SetterRes p2 q2, HasBinaryCoproducts k) => SetterRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> (a ~> b) -> s ~> t Source Github #

(MonTravRes p1 q1, MonTravRes p2 q2, HasBinaryCoproducts k) => MonTravRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> r a b -> r s t Source Github #

(TravRes p1 q1, TravRes p2 q2, HasBinaryCoproducts k) => TravRes (BesideSum p1 p2 :: k -> k -> Type) (CoBesideSum q1 q2 :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => BesideSum p1 p2 s a -> CoBesideSum q1 q2 b t -> r a b -> r s t Source Github #

data UnitW (s :: k) (x :: k) where Source Github #

Witness pair with no foci at all: decompose to Unit and rebuild.

UnitW and CoUnitW are the two halves of DayUnit, one per side of the witness pair, with a phantom focus: together with Beside/CoBeside being the halves of Day, the witness pairs here are exactly the Day-monoidal structure on profunctors (Monoidal (j +-> k)), split at the focus. The split is forced: a whole DayUnit on the decomposition side would demand Unit ~> a for an arbitrary focus a.

Constructors

UnitW :: forall {k} (x :: k) (s :: k). Ob x => (s ~> (Unit :: k)) -> UnitW s x 

Instances

Instances details
Monoidal k => Profunctor (UnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> UnitW a b -> UnitW c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> UnitW a b -> UnitW c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> UnitW a b -> UnitW a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> UnitW a b -> r Source Github #

Monoidal k => Proadjunction (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => ((CoUnitW :: k -> k -> Type) :.: (UnitW :: k -> k -> Type)) a a Source Github #

counit :: ((UnitW :: k -> k -> Type) :.: (CoUnitW :: k -> k -> Type)) :~> ((~>) :: CAT k) Source Github #

Monoidal k => FoldRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => UnitW s a -> (a ~> m) -> s ~> m Source Github #

Monoidal k => SetterRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). UnitW s a -> CoUnitW b t -> (a ~> b) -> s ~> t Source Github #

Monoidal k => MonTravRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => UnitW s a -> CoUnitW b t -> r a b -> r s t Source Github #

Monoidal k => TravRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => UnitW s a -> CoUnitW b t -> r a b -> r s t Source Github #

data CoUnitW (x :: k) (t :: k) where Source Github #

The covariant half of the UnitW witness pair: rebuilds the target from Unit.

Constructors

CoUnitW :: forall {k} (x :: k) (t :: k). Ob x => ((Unit :: k) ~> t) -> CoUnitW x t 

Instances

Instances details
Monoidal k => Profunctor (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> CoUnitW a b -> CoUnitW c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> CoUnitW a b -> CoUnitW c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> CoUnitW a b -> CoUnitW a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> CoUnitW a b -> r Source Github #

Monoidal k => Proadjunction (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => ((CoUnitW :: k -> k -> Type) :.: (UnitW :: k -> k -> Type)) a a Source Github #

counit :: ((UnitW :: k -> k -> Type) :.: (CoUnitW :: k -> k -> Type)) :~> ((~>) :: CAT k) Source Github #

Monoidal k => FoldRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => UnitW s a -> (a ~> m) -> s ~> m Source Github #

Monoidal k => SetterRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). UnitW s a -> CoUnitW b t -> (a ~> b) -> s ~> t Source Github #

Monoidal k => MonTravRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => UnitW s a -> CoUnitW b t -> r a b -> r s t Source Github #

Monoidal k => TravRes (UnitW :: k -> k -> Type) (CoUnitW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => UnitW s a -> CoUnitW b t -> r a b -> r s t Source Github #

data ZeroW (s :: k) (x :: k) where Source Github #

Witness pair for the impossible case: decompose to the initial object -- the halves of the (unspelled) unit of Day convolution over the coproduct monoidal structure, cf. UnitW/CoUnitW.

Constructors

ZeroW :: forall {k} (x :: k) (s :: k). Ob x => (s ~> (InitialObject :: k)) -> ZeroW s x 

Instances

Instances details
HasInitialObject k => Profunctor (ZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> ZeroW a b -> ZeroW c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> ZeroW a b -> ZeroW c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> ZeroW a b -> ZeroW a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> ZeroW a b -> r Source Github #

HasInitialObject k => Proadjunction (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => ((CoZeroW :: k -> k -> Type) :.: (ZeroW :: k -> k -> Type)) a a Source Github #

counit :: ((ZeroW :: k -> k -> Type) :.: (CoZeroW :: k -> k -> Type)) :~> ((~>) :: CAT k) Source Github #

HasInitialObject k => FoldRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => ZeroW s a -> (a ~> m) -> s ~> m Source Github #

HasInitialObject k => SetterRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). ZeroW s a -> CoZeroW b t -> (a ~> b) -> s ~> t Source Github #

HasInitialObject k => MonTravRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => ZeroW s a -> CoZeroW b t -> r a b -> r s t Source Github #

HasInitialObject k => TravRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => ZeroW s a -> CoZeroW b t -> r a b -> r s t Source Github #

data CoZeroW (x :: k) (t :: k) where Source Github #

The covariant half of the ZeroW witness pair: rebuilds the target from InitialObject.

Constructors

CoZeroW :: forall {k} (x :: k) (t :: k). Ob x => ((InitialObject :: k) ~> t) -> CoZeroW x t 

Instances

Instances details
HasInitialObject k => Profunctor (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

dimap :: forall (c :: k) (a :: k) (b :: k) (d :: k). (c ~> a) -> (b ~> d) -> CoZeroW a b -> CoZeroW c d Source Github #

lmap :: forall (c :: k) (a :: k) (b :: k). (c ~> a) -> CoZeroW a b -> CoZeroW c b Source Github #

rmap :: forall (b :: k) (d :: k) (a :: k). (b ~> d) -> CoZeroW a b -> CoZeroW a d Source Github #

(\\) :: forall (a :: k) (b :: k) r. ((Ob a, Ob b) => r) -> CoZeroW a b -> r Source Github #

HasInitialObject k => Proadjunction (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

unit :: forall (a :: k). Ob a => ((CoZeroW :: k -> k -> Type) :.: (ZeroW :: k -> k -> Type)) a a Source Github #

counit :: ((ZeroW :: k -> k -> Type) :.: (CoZeroW :: k -> k -> Type)) :~> ((~>) :: CAT k) Source Github #

HasInitialObject k => FoldRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

foldMapP :: forall (m :: k) (s :: k) (a :: k). Monoid m => ZeroW s a -> (a ~> m) -> s ~> m Source Github #

HasInitialObject k => SetterRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

overP :: forall (s :: k) (a :: k) (b :: k) (t :: k). ZeroW s a -> CoZeroW b t -> (a ~> b) -> s ~> t Source Github #

HasInitialObject k => MonTravRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

monTravP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). StrongDistributiveProfunctor r => ZeroW s a -> CoZeroW b t -> r a b -> r s t Source Github #

HasInitialObject k => TravRes (ZeroW :: k -> k -> Type) (CoZeroW :: k -> k -> Type) Source Github # 
Instance details

Defined in Proarrow.Optic.Traversal

Methods

travP :: forall r (s :: k) (a :: k) (b :: k) (t :: k). (StrongDistributiveProfunctor r, Strong (ProdAction :: k -> (PROD k, k) -> Type) r) => ZeroW s a -> CoZeroW b t -> r a b -> r s t Source Github #