proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Monoid

Description

Monoids and comonoids internal to a monoidal category: a Monoid m has mempty :: Unit ~> m and mappend :: m ** m ~> m; dually a Comonoid has counit and comult. Monoids in Type are the Prelude monoids, and in a cartesian category every object is a comonoid.

Synopsis

Documentation

class (Monoidal k, Ob m) => Monoid (m :: k) where Source Github #

A monoid object in a monoidal category: a unit and an (associative, unital) multiplication for the object m. At k = Type (with tensor (,)) this is the ordinary Monoid.

Methods

mempty :: (Unit :: k) ~> m Source Github #

mappend :: (m ** m) ~> m Source Github #

Instances

Instances details
Monoid 'Z Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Simplex

Methods

mempty :: (Unit :: Nat) ~> 'Z Source Github #

mappend :: ('Z ** 'Z) ~> 'Z Source Github #

KnownNat n => Monoid (n :: Nat) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.ZX

Methods

mempty :: (Unit :: Nat) ~> n Source Github #

mappend :: (n ** n) ~> n Source Github #

Monoid 'TRU Source Github # 
Instance details

Defined in Proarrow.Monoid

Monoid m => Monoid (m :: Type) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

mempty :: (Unit :: Type) ~> m Source Github #

mappend :: (m ** m) ~> m Source Github #

Monoid ('S 'Z) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Simplex

Methods

mempty :: (Unit :: Nat) ~> 'S 'Z Source Github #

mappend :: ('S 'Z ** 'S 'Z) ~> 'S 'Z Source Github #

Monoid ('CNSTRNT ()) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Constraint

KnownListOf KnownNat ns => Monoid ('DF ns :: DIFF) Source Github #

Adding vectors: the change of a sum is passed back to both terms.

Instance details

Defined in Proarrow.Category.Instance.Diff

Methods

mempty :: (Unit :: DIFF) ~> 'DF ns Source Github #

mappend :: ('DF ns ** 'DF ns) ~> 'DF ns Source Github #

Monoid ('FH ()) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinHask

Methods

mempty :: (Unit :: FINHASK) ~> 'FH () Source Github #

mappend :: ('FH () ** 'FH ()) ~> 'FH () Source Github #

SNatI a => Monoid ('FR a :: FINREL) Source Github #
>>> import Data.Type.Nat
>>> mappend @(FR Nat3)
FinRel {unFinRel = 100 ::: 000 ::: 000 ::: 000 ::: 010 ::: 000 ::: 000 ::: 000 ::: 001 ::: VNil}
Instance details

Defined in Proarrow.Category.Instance.FinRel

Methods

mempty :: (Unit :: FINREL) ~> 'FR a Source Github #

mappend :: ('FR a ** 'FR a) ~> 'FR a Source Github #

Monoid ('FS Nat1) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinSet

Monoid ('P Void) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.PointedHask

Monoid ('P ()) Source Github #

Conjunction with False = Nothing, True = Just ()

Instance details

Defined in Proarrow.Category.Instance.PointedHask

Methods

mempty :: (Unit :: POINTED) ~> 'P () Source Github #

mappend :: ('P () ** 'P ()) ~> 'P () Source Github #

Monoid ('P [a] :: POINTED) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.PointedHask

Methods

mempty :: (Unit :: POINTED) ~> 'P [a] Source Github #

mappend :: ('P [a] ** 'P [a]) ~> 'P [a] Source Github #

Ob as => Monoid ('D as :: DOT) Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Dot

Methods

mempty :: (Unit :: DOT) ~> 'D as Source Github #

mappend :: ('D as ** 'D as) ~> 'D as Source Github #

Ob as => Monoid ('S as :: SVG) Source Github #

The unit point takes the unit wire in, and the discard point gives it out.

Instance details

Defined in Proarrow.Tools.Diagrams.Svg

Methods

mempty :: (Unit :: SVG) ~> 'S as Source Github #

mappend :: ('S as ** 'S as) ~> 'S as Source Github #

(Num a, IsNat n) => Monoid ('M n :: MatK a) Source Github #

Monoids are associative, unital algebras.

Instance details

Defined in Proarrow.Category.Instance.Mat

Methods

mempty :: (Unit :: MatK a) ~> ('M n :: MatK a) Source Github #

mappend :: (('M n :: MatK a) ** ('M n :: MatK a)) ~> ('M n :: MatK a) Source Github #

Comonoid c => Monoid ('OP c :: OPPOSITE k) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

mempty :: (Unit :: OPPOSITE k) ~> 'OP c Source Github #

mappend :: ('OP c ** 'OP c) ~> 'OP c Source Github #

(HasPullbacks k, HasProducts k, Ob a) => Monoid ('SP a :: SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Span

Methods

mempty :: (Unit :: SPAN k) ~> 'SP a Source Github #

mappend :: ('SP a ** 'SP a) ~> 'SP a Source Github #

(Scalar e, KnownListOf KnownNat ns) => Monoid ('TN ns :: TNET e) Source Github #

Merging each wire with its partner, and the unit.

Instance details

Defined in Proarrow.Category.Instance.TensorNetwork

Methods

mempty :: (Unit :: TNET e) ~> ('TN ns :: TNET e) Source Github #

mappend :: (('TN ns :: TNET e) ** ('TN ns :: TNET e)) ~> ('TN ns :: TNET e) Source Github #

Monoid a => Monoid ('R a :: REV k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Rev

Methods

mempty :: (Unit :: REV k) ~> 'R a Source Github #

mappend :: ('R a ** 'R a) ~> 'R a Source Github #

(HasCoproducts k, Ob a) => Monoid ('COPR a :: COPROD k) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

mempty :: (Unit :: COPROD k) ~> 'COPR a Source Github #

mappend :: ('COPR a ** 'COPR a) ~> 'COPR a Source Github #

(Profunctor p, MonoidalProfunctor p) => Monoid (p :: j +-> k) Source Github # 
Instance details

Defined in Proarrow.Profunctor.Instance.Day

Methods

mempty :: (Unit :: j +-> k) ~> p Source Github #

mappend :: (p ** p) ~> p Source Github #

(HasPushouts k, HasCoproducts k, Alternative f, Ob a) => Monoid ('DC a :: DECCOSPAN f) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.DecoratedCospan

Methods

mempty :: (Unit :: DECCOSPAN f) ~> ('DC a :: DECCOSPAN f) Source Github #

mappend :: (('DC a :: DECCOSPAN f) ** ('DC a :: DECCOSPAN f)) ~> ('DC a :: DECCOSPAN f) Source Github #

(Elems '[Supplies Monoid, Monoidal] cs, Ob a) => Monoid (a :: FREE cs p) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

mempty :: (Unit :: FREE cs p) ~> a Source Github #

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

combine :: forall {k} (m :: k). Monoid m => ((Unit :: k) ~> m) -> ((Unit :: k) ~> m) -> (Unit :: k) ~> m Source Github #

memptyS :: forall {a} (m :: a). Monoid m => ('[] :: [a]) ~> '[m] Source Github #

mappendS :: forall {k} (m :: k). Monoid m => '[m, m] ~> '[m] Source Github #

class (Monoid m, SymMonoidal k) => CommutativeMonoid (m :: k) Source Github #

A law-only marker class for monoids whose multiplication commutes: mappend . swap = mappend.

Instances

Instances details
KnownNat a => CommutativeMonoid (a :: Nat) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.ZX

CommutativeMonoid 'TRU Source Github # 
Instance details

Defined in Proarrow.Monoid

CommutativeMonoid () Source Github # 
Instance details

Defined in Proarrow.Monoid

KnownListOf KnownNat ns => CommutativeMonoid ('DF ns :: DIFF) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Diff

SNatI a => CommutativeMonoid ('FR a :: FINREL) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinRel

Ob as => CommutativeMonoid ('D as :: DOT) Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Dot

Ob as => CommutativeMonoid ('S as :: SVG) Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Svg

(HasZeroObject k, HasBiproducts k, Ob a, Ob b) => CommutativeMonoid (Id a b :: Type) Source Github # 
Instance details

Defined in Proarrow.Monoid

(Num a, IsNat n) => CommutativeMonoid ('M n :: MatK a) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Mat

CocommutativeComonoid c => CommutativeMonoid ('OP c :: OPPOSITE k) Source Github # 
Instance details

Defined in Proarrow.Monoid

(HasPullbacks k, HasProducts k, Ob a) => CommutativeMonoid ('SP a :: SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Span

(Scalar e, KnownListOf KnownNat ns) => CommutativeMonoid ('TN ns :: TNET e) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.TensorNetwork

(HasPushouts k, HasCoproducts k, Alternative f, Ob a) => CommutativeMonoid ('DC a :: DECCOSPAN f) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.DecoratedCospan

(Monoid a, SymMonoidal (FREE cs p)) => CommutativeMonoid (a :: FREE cs p) Source Github #

The free supply is commutative only up to interpretation (FREE has no equations); the marker holds because every fold of these arrows into a target lands in that target's commutative monoid.

Instance details

Defined in Proarrow.Monoid

newtype GenElt (x :: k) (m :: k) Source Github #

Constructors

GenElt (x ~> m) 

Instances

Instances details
(Monoid m, Comonoid x) => Monoid (GenElt x m) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

mempty :: GenElt x m Github #

mappend :: GenElt x m -> GenElt x m -> GenElt x m Github #

mconcat :: [GenElt x m] -> GenElt x m Github #

(Monoid m, Comonoid x) => Semigroup (GenElt x m) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

(<>) :: GenElt x m -> GenElt x m -> GenElt x m Github #

sconcat :: NonEmpty (GenElt x m) -> GenElt x m Github #

stimes :: Integral b => b -> GenElt x m -> GenElt x m Github #

memptyAct :: forall {m} {c} (t :: (m, c) +-> c) (a :: m) (n :: c). (MonoidalAction t, Monoid a, Ob n) => n ~> Act t a n Source Github #

mappendAct :: forall {m} {c} (t :: (m, c) +-> c) (a :: m) (n :: c). (MonoidalAction t, Monoid a, Ob n) => Act t a (Act t a n) ~> Act t a n Source Github #

class (Monoidal k, Ob c) => Comonoid (c :: k) where Source Github #

A comonoid object: an object that can be discarded (counit) and copied (comult).

Methods

counit :: c ~> (Unit :: k) Source Github #

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

Instances

Instances details
KnownNat n => Comonoid (n :: Nat) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.ZX

Methods

counit :: n ~> (Unit :: Nat) Source Github #

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

Ob a => Comonoid (a :: BOOL) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

counit :: a ~> (Unit :: BOOL) Source Github #

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

Ob a => Comonoid (a :: PREPARED) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Circuit

Methods

counit :: a ~> (Unit :: PREPARED) Source Github #

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

KnownWires a => Comonoid (a :: Wires) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Circuit

Methods

counit :: a ~> (Unit :: Wires) Source Github #

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

Ob a => Comonoid (a :: SIMULATOR) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Simulator

Methods

counit :: a ~> (Unit :: SIMULATOR) Source Github #

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

Comonoid '() Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

counit :: '() ~> (Unit :: ()) Source Github #

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

Comonoid (a :: Type) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

counit :: a ~> (Unit :: Type) Source Github #

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

Comonoid ('CNSTRNT a :: CONSTRAINT) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Constraint

KnownListOf KnownNat ns => Comonoid ('DF ns :: DIFF) Source Github #

Copying a point: the changes that come back are added.

Instance details

Defined in Proarrow.Category.Instance.Diff

Methods

counit :: 'DF ns ~> (Unit :: DIFF) Source Github #

comult :: 'DF ns ~> ('DF ns ** 'DF ns) Source Github #

Ob ('FH a) => Comonoid ('FH a :: FINHASK) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinHask

Methods

counit :: 'FH a ~> (Unit :: FINHASK) Source Github #

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

SNatI a => Comonoid ('FR a :: FINREL) Source Github #
>>> import Data.Type.Nat
>>> comult @(FR Nat3)
FinRel {unFinRel = 100000000 ::: 000010000 ::: 000000001 ::: VNil}
Instance details

Defined in Proarrow.Category.Instance.FinRel

Methods

counit :: 'FR a ~> (Unit :: FINREL) Source Github #

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

SNatI a => Comonoid ('FS a :: FINSET) Source Github #
>>> import Data.Type.Nat
>>> comult @(FS Nat4)
FinSet {unFinSet = 0 ::: 5 ::: 10 ::: 15 ::: VNil}
Instance details

Defined in Proarrow.Category.Instance.FinSet

Methods

counit :: 'FS a ~> (Unit :: FINSET) Source Github #

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

Comonoid ('L (Ur a) :: LINEAR) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Linear

Methods

counit :: 'L (Ur a) ~> (Unit :: LINEAR) Source Github #

comult :: 'L (Ur a) ~> ('L (Ur a) ** 'L (Ur a)) Source Github #

Comonoid ('L Bool) Source Github #

L Bool is a comonoid: a Bool is duplicated and discarded by case analysis, which is linear (it consumes the input exactly once). The same holds for any finite, pattern-matchable classical type. Only the Bool instance is spelled out here.

Instance details

Defined in Proarrow.Category.Instance.Linear

Comonoid ('P x :: POINTED) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.PointedHask

Methods

counit :: 'P x ~> (Unit :: POINTED) Source Github #

comult :: 'P x ~> ('P x ** 'P x) Source Github #

Ob as => Comonoid ('D as :: DOT) Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Dot

Methods

counit :: 'D as ~> (Unit :: DOT) Source Github #

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

Ob as => Comonoid ('S as :: SVG) Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Svg

Methods

counit :: 'S as ~> (Unit :: SVG) Source Github #

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

(MonoidalOrdinal n, Ob a) => Comonoid (a :: ORDINAL n) Source Github #

Every object is a comonoid by the diagonal and the map to the top. So the chain is CopyDiscard, and hence Cartesian.

Instance details

Defined in Proarrow.Category.Instance.Ordinal

Methods

counit :: a ~> (Unit :: ORDINAL n) Source Github #

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

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

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

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

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

(Num a, IsNat n) => Comonoid ('M n :: MatK a) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Mat

Methods

counit :: ('M n :: MatK a) ~> (Unit :: MatK a) Source Github #

comult :: ('M n :: MatK a) ~> (('M n :: MatK a) ** ('M n :: MatK a)) Source Github #

Monoid c => Comonoid ('OP c :: OPPOSITE k) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

counit :: 'OP c ~> (Unit :: OPPOSITE k) Source Github #

comult :: 'OP c ~> ('OP c ** 'OP c) Source Github #

(HasPullbacks k, HasProducts k, Ob a) => Comonoid ('SP a :: SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Span

Methods

counit :: 'SP a ~> (Unit :: SPAN k) Source Github #

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

(Scalar e, KnownListOf KnownNat ns) => Comonoid ('TN ns :: TNET e) Source Github #

Copying each wire, and discarding.

Instance details

Defined in Proarrow.Category.Instance.TensorNetwork

Methods

counit :: ('TN ns :: TNET e) ~> (Unit :: TNET e) Source Github #

comult :: ('TN ns :: TNET e) ~> (('TN ns :: TNET e) ** ('TN ns :: TNET e)) Source Github #

Comonoid a => Comonoid ('R a :: REV k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Rev

Methods

counit :: 'R a ~> (Unit :: REV k) Source Github #

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

(HasProducts k, Ob a) => Comonoid ('PR a :: PROD k) Source Github #

In a category with products every object is a comonoid via the diagonal and the terminal map. With this comonoid structure PROD is CopyDiscard and Cartesian.

Instance details

Defined in Proarrow.Category.Monoidal.Cartesian

Methods

counit :: 'PR a ~> (Unit :: PROD k) Source Github #

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

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

Defined in Proarrow.Category.Instance.Kleisli

Methods

counit :: a ~> (Unit :: KLEISLI p) Source Github #

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

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

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

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

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

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

Defined in Proarrow.Profunctor.Instance.Day

Methods

counit :: p ~> (Unit :: j +-> k) Source Github #

comult :: p ~> (p ** p) 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

Defined in Proarrow.Category.Monoidal.CopyDiscard

Methods

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

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

CategoryOf k => Comonoid (CatAsComonoid k :: Type -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Nat

CommutativeMonoid m => Comonoid ('M :: MONOID m) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Monoid

Methods

counit :: ('M :: MONOID m) ~> (Unit :: MONOID m) Source Github #

comult :: ('M :: MONOID m) ~> (('M :: MONOID m) ** ('M :: MONOID m)) Source Github #

Comonoid a => Comonoid ('C a :: CPS r) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cps

Methods

counit :: ('C a :: CPS r) ~> (Unit :: CPS r) Source Github #

comult :: ('C a :: CPS r) ~> (('C a :: CPS r) ** ('C a :: CPS r)) Source Github #

(HasPushouts k, HasCoproducts k, Alternative f, Ob a) => Comonoid ('DC a :: DECCOSPAN f) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.DecoratedCospan

Methods

counit :: ('DC a :: DECCOSPAN f) ~> (Unit :: DECCOSPAN f) Source Github #

comult :: ('DC a :: DECCOSPAN f) ~> (('DC a :: DECCOSPAN f) ** ('DC a :: DECCOSPAN f)) Source Github #

(Elems '[Supplies Comonoid, Monoidal] cs, Ob a) => Comonoid (a :: FREE cs p) Source Github # 
Instance details

Defined in Proarrow.Monoid

Methods

counit :: a ~> (Unit :: FREE cs p) Source Github #

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

class (Comonoid c, SymMonoidal k) => CocommutativeComonoid (c :: k) Source Github #

A law-only marker for comonoids whose comultiplication cocommutes: swap . comult = comult. Dual to CommutativeMonoid.

Instances

Instances details
KnownNat n => CocommutativeComonoid (n :: Nat) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.ZX

Ob a => CocommutativeComonoid (a :: BOOL) Source Github # 
Instance details

Defined in Proarrow.Monoid

Ob a => CocommutativeComonoid (a :: PREPARED) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Circuit

KnownWires a => CocommutativeComonoid (a :: Wires) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Circuit

Ob a => CocommutativeComonoid (a :: SIMULATOR) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Simulator

CocommutativeComonoid '() Source Github # 
Instance details

Defined in Proarrow.Monoid

CocommutativeComonoid (a :: Type) Source Github # 
Instance details

Defined in Proarrow.Monoid

CocommutativeComonoid ('CNSTRNT a :: CONSTRAINT) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Constraint

KnownListOf KnownNat ns => CocommutativeComonoid ('DF ns :: DIFF) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Diff

Ob ('FH a) => CocommutativeComonoid ('FH a :: FINHASK) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinHask

SNatI a => CocommutativeComonoid ('FR a :: FINREL) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinRel

SNatI a => CocommutativeComonoid ('FS a :: FINSET) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinSet

CocommutativeComonoid ('L (Ur a) :: LINEAR) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Linear

CocommutativeComonoid ('L Bool) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Linear

CocommutativeComonoid ('P x :: POINTED) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.PointedHask

Ob as => CocommutativeComonoid ('D as :: DOT) Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Dot

Ob as => CocommutativeComonoid ('S as :: SVG) Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Svg

(MonoidalOrdinal n, Ob a) => CocommutativeComonoid (a :: ORDINAL n) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Ordinal

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

Defined in Proarrow.Category.Monoidal.CopyDiscard

(Num a, IsNat n) => CocommutativeComonoid ('M n :: MatK a) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Mat

CommutativeMonoid c => CocommutativeComonoid ('OP c :: OPPOSITE k) Source Github # 
Instance details

Defined in Proarrow.Monoid

(HasPullbacks k, HasProducts k, Ob a) => CocommutativeComonoid ('SP a :: SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Span

(Scalar e, KnownListOf KnownNat ns) => CocommutativeComonoid ('TN ns :: TNET e) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.TensorNetwork

CocommutativeComonoid a => CocommutativeComonoid ('R a :: REV k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Rev

(HasProducts k, Ob a) => CocommutativeComonoid ('PR a :: PROD k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Cartesian

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

Defined in Proarrow.Category.Instance.Kleisli

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

Defined in Proarrow.Category.Monoidal.CopyDiscard

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

Defined in Proarrow.Profunctor.Instance.Day

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

Defined in Proarrow.Category.Monoidal.CopyDiscard

CommutativeMonoid m => CocommutativeComonoid ('M :: MONOID m) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Monoid

CocommutativeComonoid a => CocommutativeComonoid ('C a :: CPS r) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cps

(HasPushouts k, HasCoproducts k, Alternative f, Ob a) => CocommutativeComonoid ('DC a :: DECCOSPAN f) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.DecoratedCospan

(Comonoid a, SymMonoidal (FREE cs p)) => CocommutativeComonoid (a :: FREE cs p) Source Github # 
Instance details

Defined in Proarrow.Monoid

counitS :: forall {k} (c :: k). Comonoid c => '[c] ~> ('[] :: [k]) Source Github #

comultS :: forall {k} (c :: k). Comonoid c => '[c] ~> '[c, c] Source Github #

data ComonoidOn (c :: k) Source Github #

A comonoid structure on c carried as a value. Unit and (**) are type families and so cannot head a Comonoid instance, yet the unit is a comonoid and, in a symmetric monoidal category, so is a tensor of comonoids. unitComonoid and tensorComonoid say so at the value level, so that withMonLens can hand back the comonoid of a composite residual (cf. withAlgP, which passes algebras the same way).

Constructors

ComonoidOn 

Fields

comonoidOn :: forall {k} (c :: k). Comonoid c => ComonoidOn c Source Github #

The comonoid structure of a Comonoid instance, as a value.

unitComonoid :: Monoidal k => ComonoidOn (Unit :: k) Source Github #

The unit is a comonoid, via the unitor.

tensorComonoid :: forall {k} (a :: k) (b :: k). SymMonoidal k => ComonoidOn a -> ComonoidOn b -> ComonoidOn (a ** b) Source Github #

In a symmetric monoidal category the tensor of two comonoids is a comonoid: counit both halves, or comultiply both halves and swap the inner pair.

counitAct :: forall {m} {c} (t :: (m, c) +-> c) (a :: m) (n :: c). (MonoidalAction t, Comonoid a, Ob n) => Act t a n ~> n Source Github #

comultAct :: forall {m} {c} (t :: (m, c) +-> c) (a :: m) (n :: c). (MonoidalAction t, Comonoid a, Ob n) => Act t a n ~> Act t a (Act t a n) Source Github #

class (forall (a :: k). Ob a => c a) => Supplies (c :: forall j. j -> Constraint) k Source Github #

Supplies c k says that every object of the category k satisfies the constraint c, e.g. Supplies Comonoid k for a category in which every object can be copied and discarded. The constraint comes first (at a higher-rank kind) so that a partial application like Supplies Comonoid has kind Kind -> Constraint and can appear in a free category's structure list (Proarrow.Category.Instance.Free). Instances are necessarily per-c (an instance variable cannot have a higher-rank kind); each follows the shape of the Comonoid one.

Instances

Instances details
(forall (a :: k). Ob a => Frobenius a) => Supplies Frobenius k Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.Hypergraph

(forall (a :: k). Ob a => CocommutativeComonoid a) => Supplies CocommutativeComonoid k Source Github # 
Instance details

Defined in Proarrow.Monoid

(forall (a :: k). Ob a => CommutativeMonoid a) => Supplies CommutativeMonoid k Source Github # 
Instance details

Defined in Proarrow.Monoid

(forall (a :: k). Ob a => Comonoid a) => Supplies Comonoid k Source Github # 
Instance details

Defined in Proarrow.Monoid

(forall (a :: k). Ob a => Monoid a) => Supplies Monoid k Source Github # 
Instance details

Defined in Proarrow.Monoid

fanIn :: forall {k} (n :: Nat) (a :: k). (SNatI n, Monoid a) => NFold n a ~> a Source Github #

Collapse an n-fold tensor power of a monoid with mappend, bottoming out at mempty.

fanOut :: forall {k} (n :: Nat) (a :: k). (SNatI n, Comonoid a) => a ~> NFold n a Source Github #

Dually, build an n-fold tensor power of a comonoid with comult, bottoming out at counit.

fanInS :: forall {k} (n :: Nat) (a :: k). (SNatI n, Monoid a) => NFoldS n a ~> '[a] Source Github #

The Strictified counterpart of fanIn.

fanOutS :: forall {k} (n :: Nat) (a :: k). (SNatI n, Comonoid a) => '[a] ~> NFoldS n a Source Github #

The Strictified counterpart of fanOut.

Orphan instances

(SymMonoidal k, Ob m) => Strong (Tensor :: k -> (k, k) -> Type) (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) :: k -> k -> Type) Source Github # 
Instance details

Methods

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

(Monoidal k, Comonoid r) => MonoidalProfunctor (Corep (Constant r) :: k -> k -> Type) Source Github # 
Instance details

Methods

one :: Corep (Constant r) (Unit :: k) (Unit :: k) Source Github #

(**) :: forall (x1 :: k) (x2 :: k) (y1 :: k) (y2 :: k). Corep (Constant r) x1 x2 -> Corep (Constant r) y1 y2 -> Corep (Constant r) (x1 ** y1) (x2 ** y2) Source Github #

(SymMonoidal k, Monoid m) => MonoidalProfunctor (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) :: k -> k -> Type) Source Github #

Tensoring with a monoid, m ** -, is an applicative functor: the monoid's unit is pure and its multiplication is *. Rendered on the representable profunctor Rep (ActionAt Tensor m) (legs a ~> m ** b) this is a StrongDistributiveProfunctor, the Writer applicative of the literature. (The Constant instances above are the degenerate case b = Unit.)

Instance details

Methods

one :: Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) (Unit :: k) (Unit :: k) Source Github #

(**) :: forall (x1 :: k) (x2 :: k) (y1 :: k) (y2 :: k). Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) x1 x2 -> Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) y1 y2 -> Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m) (x1 ** y1) (x2 ** y2) Source Github #

(Monoidal k, Monoid r) => MonoidalProfunctor (Rep (Constant r) :: k -> k -> Type) Source Github # 
Instance details

Methods

one :: Rep (Constant r) (Unit :: k) (Unit :: k) Source Github #

(**) :: forall (x1 :: k) (x2 :: k) (y1 :: k) (y2 :: k). Rep (Constant r) x1 x2 -> Rep (Constant r) y1 y2 -> Rep (Constant r) (x1 ** y1) (x2 ** y2) 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 # 
Instance details

Methods

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

(Monoidal k, HasCoproducts k, Ob m) => MonoidalProfunctor (Coprod (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m)) :: COPROD k -> COPROD k -> Type) Source Github # 
Instance details

Methods

one :: Coprod (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m)) (Unit :: COPROD k) (Unit :: COPROD k) Source Github #

(**) :: forall (x1 :: COPROD k) (x2 :: COPROD k) (y1 :: COPROD k) (y2 :: COPROD k). Coprod (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m)) x1 x2 -> Coprod (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m)) y1 y2 -> Coprod (Rep (ActionAt (Tensor :: k -> (k, k) -> Type) m)) (x1 ** y1) (x2 ** y2) Source Github #

(HasCoproducts k, Ob r) => MonoidalProfunctor (Coprod (Rep (Constant r)) :: COPROD k -> COPROD k -> Type) Source Github # 
Instance details

Methods

one :: Coprod (Rep (Constant r)) (Unit :: COPROD k) (Unit :: COPROD k) Source Github #

(**) :: forall (x1 :: COPROD k) (x2 :: COPROD k) (y1 :: COPROD k) (y2 :: COPROD k). Coprod (Rep (Constant r)) x1 x2 -> Coprod (Rep (Constant r)) y1 y2 -> Coprod (Rep (Constant r)) (x1 ** y1) (x2 ** y2) Source Github #

(HasZeroObject k, HasBiproducts k, Ob a, Ob b) => Monoid (Id a b) Source Github # 
Instance details

Methods

mempty :: Id a b Github #

mappend :: Id a b -> Id a b -> Id a b Github #

mconcat :: [Id a b] -> Id a b Github #

(HasZeroObject k, HasBiproducts k, Ob a, Ob b) => Semigroup (Id a b) Source Github # 
Instance details

Methods

(<>) :: Id a b -> Id a b -> Id a b Github #

sconcat :: NonEmpty (Id a b) -> Id a b Github #

stimes :: Integral b0 => b0 -> Id a b -> Id a b Github #