proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Tools.SMC.Internal.Frobenius

Description

Internal module of Proarrow.Tools.SMC: index notation for categories whose index types are Frobenius algebras. It exports everything, also what the public module keeps hidden.

Synopsis

Documentation

sumOver :: forall {k} {p :: k +-> k} (a :: SYN k) (d :: Nat) (r :: Ctx k) (b :: SYN k) t cont. (Profunctor p, Frobenius (Interp a), Binds p d r a b t cont) => (t -> cont) -> TermP p d r b Source Github #

An index summed over: the binder's variable is fed by the unit of its type's monoid, which, copied to every use, is the sum over all the values the index can take. The body receives the index through a pattern (see Patterns).

sumVar :: forall {k} {p :: k +-> k} (a :: SYN k) (d :: Nat) (g' :: Ctx k) (g :: Ctx k) (b :: SYN k). (Profunctor p, Frobenius (Interp a), KnownObj a, BindVar d a g' g) => TermP p (d + 1) g' b -> TermP p d g b Source Github #

An index summed over, as sumOver, for a body that refers to the index as the variable of id d instead of through a pattern.

delta :: forall {k} {p :: k +-> k} (a :: SYN k) (d :: Nat) (g1 :: Ctx k) (g2 :: Ctx k). (MonoidalProfunctor p, Frobenius (Interp a), KnownObj a, Merge g1 g2) => TermP p d g1 a -> TermP p d g2 a -> TermP p d (Union g1 g2) ('I :: SYN k) Source Github #

The Kronecker delta: the scalar that says two wires of an index type carry the same value. It is the cap of the Frobenius algebra, counit . mappend.

(*^) :: forall {k} {p :: k +-> k} (d :: Nat) (g1 :: Ctx k) (g2 :: Ctx k) (a :: SYN k) (s :: SYN k) t. (MonoidalProfunctor p, KnownObj a, Merge g1 g2, Interp s ~ (Unit :: k), ToTerm p t d g1 s) => t -> TermP p d g2 a -> TermP p d (Union g1 g2) a infixl 7 Source Github #

A term multiplied by a scalar on its left. The scalar's type interprets to Unit, including both I and F Unit. At I it is the product of two scalars.

(^*) :: forall {k} {p :: k +-> k} (d :: Nat) (g1 :: Ctx k) (g2 :: Ctx k) (a :: SYN k) (s :: SYN k) t. (MonoidalProfunctor p, KnownObj a, Merge g1 g2, Interp s ~ (Unit :: k), ToTerm p t d g2 s) => TermP p d g1 a -> t -> TermP p d (Union g1 g2) a infixl 7 Source Github #

A term multiplied by a scalar on its right.