| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Category.Monoidal.Strength
Description
Profunctor strength for a monoidal action: lets Strong t pp absorb the action of t
via act, with MonStrong the self-action (tensor) case; Costrong is the dual, and a
TracedMonoidal category is one whose hom-profunctor is costrong for its own tensor.
Synopsis
- class (MonoidalAction t, Profunctor p) => Strong (t :: (m, k) +-> k) (p :: k +-> k) where
- type MonStrong (p :: k +-> k) = (Strong (Tensor :: k -> (k, k) -> Type) p, SymMonoidal k)
- strength :: forall {k} {m} (t :: (m, k) +-> k) (p :: k +-> k) (a :: m) (b :: k). (Representable p, Strong t p, Ob a, Ob b) => Act t a (p % b) ~> (p % Act t a b)
- costrength :: forall {j} {m} (t :: (m, j) +-> j) (p :: j +-> j) (a :: m) (b :: j). (Corepresentable p, Strong t p, Ob a, Ob b) => (p %% Act t a b) ~> Act t a (p %% b)
- first' :: forall {k} {p} (c :: k) (a :: k) (b :: k). (MonStrong p, Ob c) => p a b -> p (a ** c) (b ** c)
- second' :: forall {k} {p} (c :: k) (a :: k) (b :: k). (MonStrong p, Ob c) => p a b -> p (c ** a) (c ** b)
- left' :: forall {k} p (c :: k) (a :: k) (b :: k). (Strong (CoprodAction :: k -> (COPROD k, k) -> Type) p, HasBinaryCoproducts k, Ob c) => p a b -> p (a || c) (b || c)
- right' :: forall {k} p (c :: k) (a :: k) (b :: k). (Strong (CoprodAction :: k -> (COPROD k, k) -> Type) p, Ob c) => p a b -> p (c || a) (c || b)
- premon :: forall {k} {p} (a :: k) (b :: k) (c :: k) (d :: k). (MonStrong p, Promonad p) => p a b -> p c d -> p (a ** c) (b ** d)
- strongId :: forall {k} {p} (a :: k). (MonStrong p, MonoidalProfunctor p, Ob a) => p a a
- monActDefault :: forall {k} {p} (a :: k) (x :: k) (y :: k). (MonoidalProfunctor p, Promonad p, Ob a) => p x y -> p (a ** x) (a ** y)
- class (MonoidalAction t, Profunctor p) => Costrong (t :: (m, k) +-> k) (p :: k +-> k) where
- trace :: forall {k} p (u :: k) (x :: k) (y :: k). (Costrong (Tensor :: k -> (k, k) -> Type) p, Ob x, Ob y, Ob u, SymMonoidal k) => p (x ** u) (y ** u) -> p x y
- class (Costrong (Tensor :: k -> (k, k) -> Type) (Hom k), SymMonoidal k) => TracedMonoidal k
- type TracedStructures = '[Monoidal, SymMonoidal, TracedMonoidal]
Documentation
class (MonoidalAction t, Profunctor p) => Strong (t :: (m, k) +-> k) (p :: k +-> k) where Source Github #
Profunctorial strength for a monoidal action. Gives functorial strength for representable profunctors, and functorial costrength for corepresentable profunctors.
Methods
act :: forall (a :: m) (x :: k) (y :: k). Ob a => p x y -> p (Act t a x) (Act t a y) Source Github #
Instances
| MonoidalAction t => Strong (t :: (m, k) +-> k) (Id :: k -> k -> Type) Source Github # | |
| Strong t p => Strong (t :: (m, k) +-> k) (Fix p :: k -> k -> Type) Source Github # | |
| (Strong t p, Strong t q) => Strong (t :: (m, j) +-> j) (p :+: q :: j -> j -> Type) Source Github # | |
| (Strong t p, Strong t q) => Strong (t :: (m, j) +-> j) (p :*: q :: j -> j -> Type) Source Github # | |
| (Strong t p, Strong t q) => Strong (t :: (m, i) +-> i) (p :.: q :: i -> i -> Type) Source Github # | |
| Monad m => Strong (Tensor :: Type -> (Type, Type) -> Type) (Kleisli m :: Type -> Type -> Type) Source Github # | |
| Arrow arr => Strong (Tensor :: Type -> (Type, Type) -> Type) (Arr arr :: Type -> Type -> Type) Source Github # | |
| Strong (Tensor :: Type -> (Type, Type) -> Type) (Cont r :: Type -> Type -> Type) Source Github # | |
| (CopyDiscard k, SNatI n) => Strong (Tensor :: k -> (k, k) -> Type) (Pow n :: k -> k -> Type) Source Github # | |
| (Ob r, SymMonoidal k) => Strong (Tensor :: k -> (k, k) -> Type) (Reader ('OP r) :: k -> k -> Type) Source Github # | |
| (Ob w, SymMonoidal k) => Strong (Tensor :: k -> (k, k) -> Type) (Writer w :: k -> k -> Type) Source Github # | |
| Functor f => Strong (Tensor :: Type -> (Type, Type) -> Type) (Star f :: Type -> Type -> Type) Source Github # | |
| (SymMonoidal k, Ob m) => Strong (Tensor :: k -> (k, k) -> Type) (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) :: k -> k -> Type) Source Github # | |
| (Closed k, SymMonoidal k, Ob m) => Strong (Tensor :: k -> (k, k) -> Type) (Rep (Exp m) :: k -> k -> Type) Source Github # | |
| (CopyDiscard k, Ob r) => Strong (Tensor :: k -> (k, k) -> Type) (Rep (Constant r) :: k -> k -> Type) Source Github # | The constant functor ignores the acting object: discard it. Only copying/discarding is needed, so this works in biproduct categories as well as cartesian ones. |
| (Strong (Tensor :: k -> (k, k) -> Type) p, Ob r, SymMonoidal k) => Strong (Tensor :: k -> (k, k) -> Type) (ReaderT ('OP r) p :: k -> k -> Type) Source Github # | |
| (Strong (Tensor :: k -> (k, k) -> Type) p, Ob s, SymMonoidal k) => Strong (Tensor :: k -> (k, k) -> Type) (StateT s p :: k -> k -> Type) Source Github # | |
| (Strong (Tensor :: k -> (k, k) -> Type) p, Ob w, SymMonoidal k) => Strong (Tensor :: k -> (k, k) -> Type) (WriterT w p :: k -> k -> Type) Source Github # | |
| (Monoidal k, Ob a, Ob b, Flavor w, forall (x :: k). Ob x => w (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) x)) (Corep (ActionAt (Tensor :: k -> (k, k) -> Type) x))) => Strong (Tensor :: k -> (k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | |
| MonadPlus m => Strong (CoprodAction :: Type -> (COPROD Type, Type) -> Type) (Kleisli m :: Type -> Type -> Type) Source Github # | |
| BiCCC k => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (Fold :: k -> k -> Type) Source Github # | |
| (CopyDiscard k, HasCoproducts k, SNatI n) => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (Pow n :: k -> k -> Type) Source Github # | |
| Applicative f => Strong (CoprodAction :: Type -> (COPROD Type, Type) -> Type) (Star f :: Type -> Type -> Type) Source Github # | |
| (Monoidal k, HasCoproducts k, Monoid m) => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) :: k -> k -> Type) Source Github # | |
Defined in Proarrow.Monoid | |
| (Closed k, HasCoproducts k, Comonoid m) => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (Rep (Exp m) :: k -> k -> Type) Source Github # | |
| (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. |
| Functor f => Strong (ProdAction :: Type -> (PROD Type, Type) -> Type) (Star (Prelude f) :: Type -> Type -> Type) Source Github # | |
| (HasCoproducts k, Ob a, Ob b, Flavor w, forall (t :: k). Ob t => w (Rep (Coproduct t)) (Corep (Coproduct t))) => Strong (CoprodAction :: k -> (COPROD k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | |
| (HasProducts k, Ob a, Ob b, Flavor w, forall (s :: k). Ob s => w (Rep (Product s)) (Corep (Product s))) => Strong (ProdAction :: k -> (PROD k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | |
| (CategoryOf j, CategoryOf k) => Strong (ProdAction :: (j +-> k) -> (PROD (j +-> k), j +-> k) -> Type) (Prof :: (j +-> k) -> (j +-> k) -> Type) Source Github # | |
Defined in Proarrow.Category.Monoidal.Strength | |
| Applicative f => Strong (SubAction Traversable ApplyAction) (Star (Prelude f) :: Type -> Type -> Type) Source Github # | |
Defined in Proarrow.Profunctor.Instance.Star Methods act :: forall (a :: SUBCAT Traversable) x y. Ob a => Star (Prelude f) x y -> Star (Prelude f) (Act (SubAction Traversable ApplyAction) a x) (Act (SubAction Traversable ApplyAction) a y) Source Github # | |
type MonStrong (p :: k +-> k) = (Strong (Tensor :: k -> (k, k) -> Type) p, SymMonoidal k) Source Github #
strength :: forall {k} {m} (t :: (m, k) +-> k) (p :: k +-> k) (a :: m) (b :: k). (Representable p, Strong t p, Ob a, Ob b) => Act t a (p % b) ~> (p % Act t a b) Source Github #
If a strong profunctor is representable, we get the usual strength for the representing functor.
costrength :: forall {j} {m} (t :: (m, j) +-> j) (p :: j +-> j) (a :: m) (b :: j). (Corepresentable p, Strong t p, Ob a, Ob b) => (p %% Act t a b) ~> Act t a (p %% b) Source Github #
If a strong profunctor is corepresentable, we get the usual costrength for the representing functor.
first' :: forall {k} {p} (c :: k) (a :: k) (b :: k). (MonStrong p, Ob c) => p a b -> p (a ** c) (b ** c) Source Github #
second' :: forall {k} {p} (c :: k) (a :: k) (b :: k). (MonStrong p, Ob c) => p a b -> p (c ** a) (c ** b) Source Github #
left' :: forall {k} p (c :: k) (a :: k) (b :: k). (Strong (CoprodAction :: k -> (COPROD k, k) -> Type) p, HasBinaryCoproducts k, Ob c) => p a b -> p (a || c) (b || c) Source Github #
right' :: forall {k} p (c :: k) (a :: k) (b :: k). (Strong (CoprodAction :: k -> (COPROD k, k) -> Type) p, Ob c) => p a b -> p (c || a) (c || b) Source Github #
premon :: forall {k} {p} (a :: k) (b :: k) (c :: k) (d :: k). (MonStrong p, Promonad p) => p a b -> p c d -> p (a ** c) (b ** d) Source Github #
This is not monoidal ** but premonoidal, i.e. no sliding. So with `premon f g` the effects of f happen before the effects of g. p needs to be a commutative promonad for this to be monoidal **.
strongId :: forall {k} {p} (a :: k). (MonStrong p, MonoidalProfunctor p, Ob a) => p a a Source Github #
monActDefault :: forall {k} {p} (a :: k) (x :: k) (y :: k). (MonoidalProfunctor p, Promonad p, Ob a) => p x y -> p (a ** x) (a ** y) Source Github #
A monoidal promonad is automatically strong.
class (MonoidalAction t, Profunctor p) => Costrong (t :: (m, k) +-> k) (p :: k +-> k) where Source Github #
Methods
coact :: forall (a :: m) (x :: k) (y :: k). (Ob a, Ob x, Ob y) => p (Act t a x) (Act t a y) -> p x y Source Github #
Instances
| MonoidalAction t => Costrong (t :: (Nat, Nat) +-> Nat) ZX Source Github # | |
| MonoidalAction t => Costrong (t :: (FINREL, FINREL) +-> FINREL) FinRel Source Github # | |
| (MonoidalAction t, Costrong t (Hom k)) => Costrong (t :: (m, k) +-> k) (Id :: k -> k -> Type) Source Github # | |
| Costrong (Tensor :: DOT -> (DOT, DOT) -> Type) Dot Source Github # | |
| Costrong (Tensor :: SVG -> (SVG, SVG) -> Type) Svg Source Github # | The traced wires loop round the side of the diagram they are nearest to. |
| MonadFix m => Costrong (Tensor :: Type -> (Type, Type) -> Type) (Kleisli m :: Type -> Type -> Type) Source Github # | |
| ArrowLoop arr => Costrong (Tensor :: Type -> (Type, Type) -> Type) (Arr arr :: Type -> Type -> Type) Source Github # | |
| Costrong (Tensor :: Type -> (Type, Type) -> Type) (->) Source Github # | |
| (Monoidal k, Ob a, Ob b, Flavor w, forall (m :: k). Ob m => w (Corep (ActionAt (Tensor :: k -> (k, k) -> Type) m)) (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m))) => Costrong (Tensor :: k -> (k, k) -> Type) (ExOptic w a b :: k -> k -> Type) Source Github # | The generic carrier absorbs the residual of a |
| Costrong (CoprodAction :: LINEAR -> (COPROD LINEAR, LINEAR) -> Type) Linear Source Github # | |
Defined in Proarrow.Category.Instance.Linear | |
| Cartesian k => Costrong (ProdAction :: k -> (PROD k, k) -> Type) (Fold :: k -> k -> Type) Source Github # | |
| (Num a, MonoidalAction t) => Costrong (t :: (MatK a, MatK a) +-> MatK a) (Mat :: MatK a -> MatK a -> Type) Source Github # | |
trace :: forall {k} p (u :: k) (x :: k) (y :: k). (Costrong (Tensor :: k -> (k, k) -> Type) p, Ob x, Ob y, Ob u, SymMonoidal k) => p (x ** u) (y ** u) -> p x y Source Github #
class (Costrong (Tensor :: k -> (k, k) -> Type) (Hom k), SymMonoidal k) => TracedMonoidal k Source Github #
Instances
| (Costrong (Tensor :: k -> (k, k) -> Type) (Hom k), SymMonoidal k) => TracedMonoidal k Source Github # | |
Defined in Proarrow.Category.Monoidal.Strength | |
type TracedStructures = '[Monoidal, SymMonoidal, TracedMonoidal] Source Github #
The structures the laws of a traced monoidal category are stated for.