proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Category.Instance.Cospan

Description

The category of cospans in k: objects are those of k (wrapped in CS), and a morphism a ~> b is a cospan a -> x <- b, composed by pushout. With the coproduct of k as tensor every object is a Frobenius monoid, giving a Hypergraph, compact closed, dagger category. This is the archetypal setting for undirected wiring diagrams.

These are the decorated cospans of Proarrow.Category.Instance.DecoratedCospan without a decoration, which is where their structure comes from.

Synopsis

Documentation

type CS = 'DC :: k -> DECCOSPAN (Undecorated :: k -> Type) Source Github #

An object of k as one of COSPAN k.

pattern Cospan :: forall {k} {a} {b} (c :: k) (a' :: k) (b' :: k). () => (a ~ CS a', b ~ CS b') => (a' ~> c) -> (b' ~> c) -> Cospan a b Source Github #

A cospan a -> c <- b.

data Undecorated (c :: k) Source Github #

The decoration that says nothing.

Constructors

Undecorated 

Instances

Instances details
HasBinaryCoproducts k => Alternative (Undecorated :: k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

Methods

empty :: forall (a :: k). Ob a => (Unit :: Type) ~> Undecorated a Source Github #

alt :: forall (a :: k) (b :: k) (c :: k). (Ob a, Ob b) => ((a || b) ~> c) -> (Undecorated a ** Undecorated b) ~> Undecorated c Source Github #

CategoryOf k => Functor (Undecorated :: k -> Type) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

Methods

map :: forall (a :: k) (b :: k). (a ~> b) -> Undecorated a ~> Undecorated b Source Github #

(HasPushouts k, HasCoproducts k, HasPullbacks k) => FunctorForRep (Pullback :: COSPAN k +-> SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

Methods

fmap :: forall (a :: COSPAN k) (b :: COSPAN k). (a ~> b) -> ((Pullback :: COSPAN k +-> SPAN k) @ a) ~> ((Pullback :: COSPAN k +-> SPAN k) @ b) Source Github #

(HasPushouts k, HasCoproducts k, HasPullbacks k) => FunctorForRep (Pushout :: SPAN k +-> COSPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

Methods

fmap :: forall (a :: SPAN k) (b :: SPAN k). (a ~> b) -> ((Pushout :: SPAN k +-> COSPAN k) @ a) ~> ((Pushout :: SPAN k +-> COSPAN k) @ b) Source Github #

type (Pullback :: COSPAN k +-> SPAN k) @ (CS a :: COSPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

type (Pullback :: COSPAN k +-> SPAN k) @ (CS a :: COSPAN k) = 'SP a
type (Pushout :: SPAN k +-> COSPAN k) @ ('SP a :: SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

type (Pushout :: SPAN k +-> COSPAN k) @ ('SP a :: SPAN k) = CS a

arr :: forall k (a :: k) (b :: k). CategoryOf k => (a ~> b) -> Cospan (CS a) (CS b) Source Github #

coarr :: forall k (a :: k) (b :: k). CategoryOf k => (a ~> b) -> Cospan (CS b) (CS a) Source Github #

data family Pushout :: SPAN k +-> COSPAN k Source Github #

Instances

Instances details
(HasPushouts k, HasCoproducts k, HasPullbacks k) => FunctorForRep (Pushout :: SPAN k +-> COSPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

Methods

fmap :: forall (a :: SPAN k) (b :: SPAN k). (a ~> b) -> ((Pushout :: SPAN k +-> COSPAN k) @ a) ~> ((Pushout :: SPAN k +-> COSPAN k) @ b) Source Github #

type (Pushout :: SPAN k +-> COSPAN k) @ ('SP a :: SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

type (Pushout :: SPAN k +-> COSPAN k) @ ('SP a :: SPAN k) = CS a

data family Pullback :: COSPAN k +-> SPAN k Source Github #

Instances

Instances details
(HasPushouts k, HasCoproducts k, HasPullbacks k) => FunctorForRep (Pullback :: COSPAN k +-> SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

Methods

fmap :: forall (a :: COSPAN k) (b :: COSPAN k). (a ~> b) -> ((Pullback :: COSPAN k +-> SPAN k) @ a) ~> ((Pullback :: COSPAN k +-> SPAN k) @ b) Source Github #

type (Pullback :: COSPAN k +-> SPAN k) @ (CS a :: COSPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Cospan

type (Pullback :: COSPAN k +-> SPAN k) @ (CS a :: COSPAN k) = 'SP a