| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Category.Monoidal.Hypergraph
Synopsis
- type family NFold (n :: Nat) (x :: k) :: k where ...
- withObNFold :: forall {k} (n :: Nat) (a :: k) r. (SNatI n, Ob a, Monoidal k) => (Ob (NFold n a) => r) -> r
- fanIn :: forall {k} (n :: Nat) (a :: k). (SNatI n, Monoid a) => NFold n a ~> a
- fanOut :: forall {k} (n :: Nat) (a :: k). (SNatI n, Comonoid a) => a ~> NFold n a
- class (Monoid a, Comonoid a) => Frobenius (a :: k) where
- cup :: forall {k} (a :: k). Frobenius a => (Unit :: k) ~> (a ** a)
- cap :: forall {k} (a :: k). Frobenius a => (a ** a) ~> (Unit :: k)
- spiderDefault :: forall {k} (n :: Nat) (m :: Nat) (a :: k). (Monoid a, Comonoid a, SNatI n, SNatI m) => NFold n a ~> NFold m a
- class (Supplies k (Frobenius :: k -> Constraint), CompactClosed k) => Hypergraph k
- dualHG :: forall {k} (a :: k) (b :: k). Hypergraph k => (a ~> b) -> b ~> a
- linDistHG :: forall {k} (a :: k) (b :: k) (c :: k). (Hypergraph k, Ob a, Ob b) => ((a ** b) ~> c) -> a ~> (b ** c)
- linDistInvHG :: forall {k} (a :: k) (b :: k) (c :: k). (Hypergraph k, Ob b, Ob c) => (a ~> (b ** c)) -> (a ** b) ~> c
- traceHG :: forall {k} (u :: k) (x :: k) (y :: k). (Hypergraph k, Ob x, Ob y, Ob u) => ((u ** x) ~> (u ** y)) -> x ~> y
- type ExpHG (a :: k) (b :: k) = a ** b
- curryHG :: forall {k} (a :: k) (b :: k) (c :: k). (Hypergraph k, Ob a, Ob b) => ((a ** b) ~> c) -> a ~> ExpHG b c
- applyHG :: forall {k} (b :: k) (c :: k). (Hypergraph k, Ob b, Ob c) => (ExpHG b c ** b) ~> c
Documentation
withObNFold :: forall {k} (n :: Nat) (a :: k) r. (SNatI n, Ob a, Monoidal k) => (Ob (NFold n a) => r) -> r Source Github #
class (Monoid a, Comonoid a) => Frobenius (a :: k) where Source Github #
We have a special frobenius algebra for an object if it is a monoid and a comonoid in a nice compatible way.
Then there's a unique way to go from n-fold a to m-fold a.
Methods
spider :: forall (n :: Nat) (m :: Nat). (SNatI n, SNatI m) => NFold n a ~> NFold m a Source Github #
Instances
| KnownNat a => Frobenius (a :: Nat) Source Github # | |
| SNatI a => Frobenius ('FR a :: FINREL) Source Github # | |
| (HasPushouts k, Ob a) => Frobenius ('CS a :: COSPAN k) Source Github # | |
| (Num a, IsNat n) => Frobenius ('M n :: MatK a) Source Github # | |
| (HasPullbacks k, Ob a) => Frobenius ('SP a :: SPAN k) Source Github # | |
spiderDefault :: forall {k} (n :: Nat) (m :: Nat) (a :: k). (Monoid a, Comonoid a, SNatI n, SNatI m) => NFold n a ~> NFold m a Source Github #
Since spider has a (very) ambiguous type, it's not possible to give a default implementation. Use this function to provide the implementation as follows:
spider @n @m = spiderDefault @n @m @a
class (Supplies k (Frobenius :: k -> Constraint), CompactClosed k) => Hypergraph k Source Github #
A hypergraph category has a special frobenius algebra for every object, and the frobenius algebra of any tensor product X ⊗ Y is induced in the canonical way from those of X and Y.
Instances
| Hypergraph FINREL Source Github # | |
Defined in Proarrow.Category.Instance.FinRel | |
| HasPushouts k => Hypergraph (COSPAN k) Source Github # | |
Defined in Proarrow.Category.Instance.Cospan | |
| Num a => Hypergraph (MatK a) Source Github # | |
Defined in Proarrow.Category.Instance.Mat | |
| HasPullbacks k => Hypergraph (SPAN k) Source Github # | |
Defined in Proarrow.Category.Instance.Span | |
dualHG :: forall {k} (a :: k) (b :: k). Hypergraph k => (a ~> b) -> b ~> a Source Github #
A hypergraph category is self-dual compact closed.
linDistHG :: forall {k} (a :: k) (b :: k) (c :: k). (Hypergraph k, Ob a, Ob b) => ((a ** b) ~> c) -> a ~> (b ** c) Source Github #
linDistInvHG :: forall {k} (a :: k) (b :: k) (c :: k). (Hypergraph k, Ob b, Ob c) => (a ~> (b ** c)) -> (a ** b) ~> c Source Github #
traceHG :: forall {k} (u :: k) (x :: k) (y :: k). (Hypergraph k, Ob x, Ob y, Ob u) => ((u ** x) ~> (u ** y)) -> x ~> y Source Github #
A hypergraph category has a trace