proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Category.Monoidal.CopyDiscard

Description

Monoidal categories in which every object carries a cocommutative comonoid (the Supplies CocommutativeComonoid k superclass), with copy :: a ~> a ** a and discard :: a ~> Unit defaulting to its comult/counit. This gives projections fst/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

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

Instances details
CopyDiscard Nat Source Github # 
Instance details

Defined in Proarrow.Category.Instance.ZX

Methods

copy :: forall (a :: Nat). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: Nat). Ob a => a ~> (Unit :: Nat) Source Github #

CopyDiscard BOOL Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

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

discard :: forall (a :: BOOL). Ob a => a ~> (Unit :: BOOL) Source Github #

CopyDiscard CONSTRAINT Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Constraint

Methods

copy :: forall (a :: CONSTRAINT). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: CONSTRAINT). Ob a => a ~> (Unit :: CONSTRAINT) Source Github #

CopyDiscard FINHASK Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinHask

Methods

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

discard :: forall (a :: FINHASK). Ob a => a ~> (Unit :: FINHASK) Source Github #

CopyDiscard FINREL Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinRel

Methods

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

discard :: forall (a :: FINREL). Ob a => a ~> (Unit :: FINREL) Source Github #

CopyDiscard FINSET Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinSet

Methods

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

discard :: forall (a :: FINSET). Ob a => a ~> (Unit :: FINSET) Source Github #

CopyDiscard POINTED Source Github # 
Instance details

Defined in Proarrow.Category.Instance.PointedHask

Methods

copy :: forall (a :: POINTED). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: POINTED). Ob a => a ~> (Unit :: POINTED) Source Github #

CopyDiscard DOT Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Dot

Methods

copy :: forall (a :: DOT). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: DOT). Ob a => a ~> (Unit :: DOT) Source Github #

CopyDiscard SVG Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Svg

Methods

copy :: forall (a :: SVG). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: SVG). Ob a => a ~> (Unit :: SVG) Source Github #

CopyDiscard () Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

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

discard :: forall (a :: ()). Ob a => a ~> (Unit :: ()) Source Github #

CopyDiscard Type Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

copy :: Ob a => a ~> (a ** a) Source Github #

discard :: Ob a => a ~> (Unit :: Type) Source Github #

(HasPushouts k, HasCoproducts k) => CopyDiscard (COSPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

Methods

copy :: forall (a :: COSPAN k). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: COSPAN k). Ob a => a ~> (Unit :: COSPAN k) Source Github #

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

Defined in Proarrow.Category.Instance.Mat

Methods

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

discard :: forall (a0 :: MatK a). Ob a0 => a0 ~> (Unit :: MatK a) Source Github #

MonoidalOrdinal n => CopyDiscard (ORDINAL n) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Ordinal

Methods

copy :: forall (a :: ORDINAL n). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: ORDINAL n). Ob a => a ~> (Unit :: ORDINAL n) Source Github #

(HasPullbacks k, HasProducts k) => CopyDiscard (SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Span

Methods

copy :: forall (a :: SPAN k). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: SPAN k). Ob a => a ~> (Unit :: SPAN k) Source Github #

CopyDiscard k => CopyDiscard (REV k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Rev

Methods

copy :: forall (a :: REV k). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: REV k). Ob a => a ~> (Unit :: REV k) Source Github #

HasProducts k => CopyDiscard (PROD k) Source Github #

A category with products, viewed through PROD as a monoidal category, is cartesian.

Instance details

Defined in Proarrow.Category.Monoidal.Cartesian

Methods

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

discard :: forall (a :: PROD k). Ob a => a ~> (Unit :: PROD k) Source Github #

CopyDiscard k => CopyDiscard [k] Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

copy :: forall (a :: [k]). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: [k]). Ob a => a ~> (Unit :: [k]) Source Github #

(Promonad p, MonoidalProfunctor p, CopyDiscard k) => CopyDiscard (KLEISLI p) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Kleisli

Methods

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

discard :: forall (a :: KLEISLI p). Ob a => a ~> (Unit :: KLEISLI p) Source Github #

CommutativeMonoid m => CopyDiscard (MONOID m) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Monoid

Methods

copy :: forall (a :: MONOID m). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: MONOID m). Ob a => a ~> (Unit :: MONOID m) Source Github #

(SubMonoidal ob, CopyDiscard k) => CopyDiscard (SUBCAT ob) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

copy :: forall (a :: SUBCAT ob). Ob a => a ~> (a ** a) Source Github #

discard :: forall (a :: SUBCAT ob). Ob a => a ~> (Unit :: SUBCAT ob) Source Github #

(SymMonoidal j, CopyDiscard k, Supplies CommutativeMonoid j) => CopyDiscard (j +-> k) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Day

Methods

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

discard :: forall (a :: j +-> k). Ob a => a ~> (Unit :: j +-> k) Source Github #

(CopyDiscard j, CopyDiscard k) => CopyDiscard (j, k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

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

discard :: forall (a :: (j, k)). Ob a => a ~> (Unit :: (j, k)) Source Github #

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.

copyS :: forall k (a :: k). (CopyDiscard k, Ob a) => '[a] ~> '[a, a] Source Github #

discardS :: forall k (a :: k). (CopyDiscard k, Ob a) => '[a] ~> ('[] :: [k]) Source Github #

fst :: forall {k} (a :: k) (b :: k). (CopyDiscard k, Ob a, Ob b) => (a ** b) ~> a Source Github #

snd :: forall {k} (a :: k) (b :: k). (CopyDiscard k, Ob a, Ob b) => (a ** b) ~> b Source Github #

(&&&) :: 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.

Instance details

Methods

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

(CopyDiscard k, Ob as) => CocommutativeComonoid (as :: [k]) Source Github # 
Instance details

(CopyDiscard k, Ob as) => Comonoid (as :: [k]) Source Github # 
Instance details

Methods

counit :: as ~> (Unit :: [k]) Source Github #

comult :: as ~> (as ** as) Source Github #

(SubMonoidal ob, CopyDiscard k, Ob a) => CocommutativeComonoid (a :: SUBCAT ob) Source Github # 
Instance details

(CopyDiscard j, CopyDiscard k, Ob a) => CocommutativeComonoid (a :: (j, k)) Source Github # 
Instance details

(SubMonoidal ob, CopyDiscard k, Ob a) => Comonoid (a :: SUBCAT ob) Source Github # 
Instance details

Methods

counit :: a ~> (Unit :: SUBCAT ob) Source Github #

comult :: a ~> (a ** a) 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 copy/discard.

Instance details

Methods

counit :: a ~> (Unit :: (j, k)) Source Github #

comult :: a ~> (a ** a) Source Github #