| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Category.Monoidal.CopyDiscard
Contents
Description
Monoidal categories in which every object carries a cocommutative comonoid (the
superclass), with Supplies CocommutativeComonoid k and
copy :: a ~> a ** a defaulting to its comult/counit. This gives projections
discard :: a ~> Unitfst/snd without tensor = product, e.g. in the biproduct categories
Proarrow.Category.Instance.Mat and Proarrow.Category.Instance.FinRel. Unlike in
Cartesian (which has this class as a superclass, by Fox's
theorem) the comonoids need not be natural, so morphisms may duplicate/delete resources
non-uniformly.
Synopsis
- class (SymMonoidal k, Supplies CocommutativeComonoid k) => CopyDiscard k where
- type CopyDiscardStructures = '[Monoidal, SymMonoidal, CopyDiscard]
- copyOfUnit :: forall {k} (a :: k) m. (CopyDiscard k, Applicative m) => m (Equation k)
- discardOfUnit :: forall {k} (a :: k) m. (CopyDiscard k, Applicative m) => m (Equation k)
- copyS :: forall k (a :: k). (CopyDiscard k, Ob a) => '[a] ~> '[a, a]
- discardS :: forall k (a :: k). (CopyDiscard k, Ob a) => '[a] ~> ('[] :: [k])
- fst :: forall {k} (a :: k) (b :: k). (CopyDiscard k, Ob a, Ob b) => (a ** b) ~> a
- snd :: forall {k} (a :: k) (b :: k). (CopyDiscard k, Ob a, Ob b) => (a ** b) ~> b
- (&&&) :: forall {k} (a :: k) (x :: k) (y :: k). CopyDiscard k => (a ~> x) -> (a ~> y) -> a ~> (x ** y)
Documentation
class (SymMonoidal k, Supplies CocommutativeComonoid k) => CopyDiscard k where Source Github #
Minimal complete definition
Nothing
Methods
copy :: forall (a :: k). Ob a => a ~> (a ** a) Source Github #
discard :: forall (a :: k). Ob a => a ~> (Unit :: k) Source Github #
Instances
type CopyDiscardStructures = '[Monoidal, SymMonoidal, CopyDiscard] Source Github #
The structures the laws of a copy-discard category are stated for.
copyOfUnit :: forall {k} (a :: k) m. (CopyDiscard k, Applicative m) => m (Equation k) Source Github #
copy on the unit is a unitor; a only says which category.
discardOfUnit :: forall {k} (a :: k) m. (CopyDiscard k, Applicative m) => m (Equation k) Source Github #
discard on the unit is the identity; a only says which category.
(&&&) :: forall {k} (a :: k) (x :: k) (y :: k). CopyDiscard k => (a ~> x) -> (a ~> y) -> a ~> (x ** y) Source Github #
Orphan instances
| (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. |
| (CopyDiscard k, Ob as) => CocommutativeComonoid (as :: [k]) Source Github # | |
| (CopyDiscard k, Ob as) => Comonoid (as :: [k]) Source Github # | |
| (SubMonoidal ob, CopyDiscard k, Ob a) => CocommutativeComonoid (a :: SUBCAT ob) Source Github # | |
| (CopyDiscard j, CopyDiscard k, Ob a) => CocommutativeComonoid (a :: (j, k)) Source Github # | |
| (SubMonoidal ob, CopyDiscard k, Ob a) => Comonoid (a :: SUBCAT ob) Source Github # | |
| (CopyDiscard j, CopyDiscard k, Ob a) => Comonoid (a :: (j, k)) Source Github # | The comonoid supply of a product category, a subcategory and a strictified category are
inherited componentwise: each object's comonoid is the ambient |