| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Circuit.Par
Description
Multiplicative disjunction (⅋) and its linear distributors.
This module surfaces the tensor product, its unit ⊥, and the one-way
distributors between tensor and tensor. These are "mixed metaphor"
structure: they relate a tensor t (typically (,)) with a tensor
product p (typically Either).
Multiplicative disjunction
class Category arr => Par (p :: k -> k -> k) (arr :: k -> k -> Type) where Source #
Multiplicative disjunction action on a category.
parP is the tensor product of morphisms. The unitors witness that
⊥ ⅋ a ≅ a and a ⅋ ⊥ ≅ a.
Methods
parP :: forall (a :: k) (b :: k) (c :: k) (d :: k). arr a b -> arr c d -> arr (p a c) (p b d) Source #
Parallel composition under tensor.
unitlP :: forall (a :: k). arr (p (Bot p) a) a Source #
Left unitor: ⊥ ⅋ a -> a.
unitlP' :: forall (a :: k). arr a (p (Bot p) a) Source #
Inverse left unitor: a -> ⊥ ⅋ a.
unitrP :: forall (a :: k). arr (p a (Bot p)) a Source #
Right unitor: a ⅋ ⊥ -> a.
unitrP' :: forall (a :: k). arr a (p a (Bot p)) Source #
Inverse right unitor: a -> a ⅋ ⊥.
Instances
| Monad m => Par Either (K m :: Type -> Type -> Type) Source # | Coproduct as multiplicative disjunction on |
| Par Either (->) Source # | Coproduct as multiplicative disjunction on functions. The unit is the initial object |
Linear distributors and mix
distL :: (a, Either b c) -> Either (a, b) c Source #
Left linear distributor: A ⊗ (B ⅋ C) -> (A ⊗ B) ⅋ C.
For (,) and Either this is the one-way product-over-coproduct map.
Note that (_, Right c) = Right c discards the a; this is legal
affinely but not in strict MLL. The distributors already live in the
affine fragment.