| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Circuit.Trace
Description
Free traced monoidal category syntax.
This module packages the traced-monoidal layer on top of the generic free-construction substrate in Circuit.Syntax. The signature sum is
SigCompose:+:SigYankt
where SigCompose provides sequential composition and SigYank provides
feedback / trace over the channel tensor t.
Higher-level signatures (parallel composition, braid, copy/discard, shared-medium fusion, mediators) live in Circuit.SMC, Circuit.Bimonoid, and Circuit.Shared.
Synopsis
- type Trace (t :: Type -> Type -> Type) (arr :: Type -> Type -> Type) = Syntax ((SigCompose :: (Type -> Type -> Type) -> (Type -> Type -> Type) -> Type -> Type -> Type) :+: (SigYank t :: (Type -> Type -> Type) -> (Type -> Type -> Type) -> Type -> Type -> Type)) arr
- base :: forall arr a b (t :: Type -> Type -> Type). arr a b -> Trace t arr a b
- yank :: forall t (arr :: Type -> Type -> Type) s a b. Trace t arr (t s a) (t s b) -> Trace t arr a b
- data SigYank (t :: Type -> Type -> Type) (arr :: k) (rec :: Type -> Type -> Type) a b where
Free traced category
type Trace (t :: Type -> Type -> Type) (arr :: Type -> Type -> Type) = Syntax ((SigCompose :: (Type -> Type -> Type) -> (Type -> Type -> Type) -> Type -> Type -> Type) :+: (SigYank t :: (Type -> Type -> Type) -> (Type -> Type -> Type) -> Type -> Type -> Type)) arr Source #
Free traced monoidal category over tensor t.
base :: forall arr a b (t :: Type -> Type -> Type). arr a b -> Trace t arr a b Source #
Lift a base arrow into the free traced category.
yank :: forall t (arr :: Type -> Type -> Type) s a b. Trace t arr (t s a) (t s b) -> Trace t arr a b Source #
Close a feedback loop over the channel tensor t.
Trace signature
data SigYank (t :: Type -> Type -> Type) (arr :: k) (rec :: Type -> Type -> Type) a b where Source #
Feedback loop / trace over tensor t.
Constructors
| Yank :: forall {k} (rec :: Type -> Type -> Type) (t :: Type -> Type -> Type) s a b (arr :: k). rec (t s a) (t s b) -> SigYank t arr rec a b |
Instances
| (Category arr, Channel t arr) => Channel (t :: Type -> Type -> Type) (Trace t arr :: Type -> Type -> Type) Source # | |
| (Strength t arr, Traced t arr) => Strength (t :: Type -> Type -> Type) (Trace t arr :: Type -> Type -> Type) Source # | |
| Traced t arr => Traced (t :: Type -> Type -> Type) (Trace t arr :: Type -> Type -> Type) Source # | |
| (Action t arr, Traced t' arr) => Action (t :: Type -> Type -> Type) (Trace t' arr :: Type -> Type -> Type) Source # | |
Defined in Circuit.Tensor | |
| (Tensor t arr, Traced t' arr) => Tensor (t :: Type -> Type -> Type) (Trace t' arr :: Type -> Type -> Type) Source # | Lift This is the single lawful instance: it evaluates each |
| Unital t arr => Unital (t :: Type -> Type -> Type) (Trace t' arr :: Type -> Type -> Type) Source # | |
| Category arr => Category (Trace t arr :: Type -> Type -> Type) Source # | |
| Traced t arr' => Algebra (SigYank t :: (Type -> Type -> Type) -> (Type -> Type -> Type) -> Type -> Type -> Type) arr arr' Source # | |
| type Ctx (SigYank t :: (Type -> Type -> Type) -> (Type -> Type -> Type) -> Type -> Type -> Type) arr arr' Source # | |