proarrow
Safe HaskellNone
LanguageGHC2024

Proarrow.Category.Monoidal.IsoMix

Description

Isomix categories: dialogue categories whose two units agree, Dual Unit, the unit of par, being isomorphic to Unit (dualUnit). Then a dual and its object can be joined into the unit of the tensor, not just into the unit of par. Every compact closed category is isomix, and so is LINEAR, where tensor and par still differ. CPS r is isomix exactly when the answer object r is the unit: with effects as the answer object, as CPS (IO ()), joining a consumer and a value into the unit would discard the effect.

Synopsis

Documentation

class Dialogue k => IsoMix k where Source Github #

Methods

dualUnit :: Dual (Unit :: k) ~> (Unit :: k) Source Github #

The unit of par is isomorphic to the unit of the tensor.

dualUnitInv :: (Unit :: k) ~> Dual (Unit :: k) Source Github #

The inverse of dualUnit.

dualityCounit :: forall (a :: k). Ob a => (Dual a ** a) ~> (Unit :: k) Source Github #

Join a dual and its object into the unit. dualityCounitDefault gives it from the dialogue structure; a compact closed category has a counit of its own. (There is no default method: a occurs only under type families, so GHC could not instantiate one.)

Instances

Instances details
IsoMix Nat Source Github # 
Instance details

Defined in Proarrow.Category.Instance.ZX

Methods

dualUnit :: Dual (Unit :: Nat) ~> (Unit :: Nat) Source Github #

dualUnitInv :: (Unit :: Nat) ~> Dual (Unit :: Nat) Source Github #

dualityCounit :: forall (a :: Nat). Ob a => (Dual a ** a) ~> (Unit :: Nat) Source Github #

IsoMix FINREL Source Github # 
Instance details

Defined in Proarrow.Category.Instance.FinRel

IsoMix LINEAR Source Github #

The unit of par is () %1 -> (), which has one value, just like (): apply it to (), or give back the identity. So LINEAR is isomix, while tensor and par still differ.

Instance details

Defined in Proarrow.Category.Instance.Linear

IsoMix DOT Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Dot

Methods

dualUnit :: Dual (Unit :: DOT) ~> (Unit :: DOT) Source Github #

dualUnitInv :: (Unit :: DOT) ~> Dual (Unit :: DOT) Source Github #

dualityCounit :: forall (a :: DOT). Ob a => (Dual a ** a) ~> (Unit :: DOT) Source Github #

IsoMix SVG Source Github # 
Instance details

Defined in Proarrow.Tools.Diagrams.Svg

Methods

dualUnit :: Dual (Unit :: SVG) ~> (Unit :: SVG) Source Github #

dualUnitInv :: (Unit :: SVG) ~> Dual (Unit :: SVG) Source Github #

dualityCounit :: forall (a :: SVG). Ob a => (Dual a ** a) ~> (Unit :: SVG) Source Github #

IsoMix () Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.IsoMix

Methods

dualUnit :: Dual (Unit :: ()) ~> (Unit :: ()) Source Github #

dualUnitInv :: (Unit :: ()) ~> Dual (Unit :: ()) Source Github #

dualityCounit :: forall (a :: ()). Ob a => (Dual a ** a) ~> (Unit :: ()) Source Github #

TracedMonoidal k => IsoMix (INT k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.IntConstruction

Methods

dualUnit :: Dual (Unit :: INT k) ~> (Unit :: INT k) Source Github #

dualUnitInv :: (Unit :: INT k) ~> Dual (Unit :: INT k) Source Github #

dualityCounit :: forall (a :: INT k). Ob a => (Dual a ** a) ~> (Unit :: INT k) Source Github #

Num a => IsoMix (MatK a) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Mat

Methods

dualUnit :: Dual (Unit :: MatK a) ~> (Unit :: MatK a) Source Github #

dualUnitInv :: (Unit :: MatK a) ~> Dual (Unit :: MatK a) Source Github #

dualityCounit :: forall (a0 :: MatK a). Ob a0 => (Dual a0 ** a0) ~> (Unit :: MatK a) Source Github #

(HasPullbacks k, HasProducts k) => IsoMix (SPAN k) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Span

Methods

dualUnit :: Dual (Unit :: SPAN k) ~> (Unit :: SPAN k) Source Github #

dualUnitInv :: (Unit :: SPAN k) ~> Dual (Unit :: SPAN k) Source Github #

dualityCounit :: forall (a :: SPAN k). Ob a => (Dual a ** a) ~> (Unit :: SPAN k) Source Github #

Scalar e => IsoMix (TNET e) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.TensorNetwork

Methods

dualUnit :: Dual (Unit :: TNET e) ~> (Unit :: TNET e) Source Github #

dualUnitInv :: (Unit :: TNET e) ~> Dual (Unit :: TNET e) Source Github #

dualityCounit :: forall (a :: TNET e). Ob a => (Dual a ** a) ~> (Unit :: TNET e) Source Github #

(Closed k, SymMonoidal k, r ~ (Unit :: k)) => IsoMix (CPS r) Source Github #

With the unit as the answer object, Dual Unit = Unit ~~> Unit ≅ Unit, and a consumer meets its value in apply. With any other answer object the units differ, so this is the only isomix instance; the constraint on r says so, since Unit is a type family and cannot head an instance.

Instance details

Defined in Proarrow.Category.Instance.Cps

Methods

dualUnit :: Dual (Unit :: CPS r) ~> (Unit :: CPS r) Source Github #

dualUnitInv :: (Unit :: CPS r) ~> Dual (Unit :: CPS r) Source Github #

dualityCounit :: forall (a :: CPS r). Ob a => (Dual a ** a) ~> (Unit :: CPS r) Source Github #

(HasPushouts k, HasCoproducts k, Alternative f) => IsoMix (DECCOSPAN f) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.DecoratedCospan

CommutativeMonoid m => IsoMix (MONOID m) Source Github # 
Instance details

Defined in Proarrow.Category.Instance.Monoid

Methods

dualUnit :: Dual (Unit :: MONOID m) ~> (Unit :: MONOID m) Source Github #

dualUnitInv :: (Unit :: MONOID m) ~> Dual (Unit :: MONOID m) Source Github #

dualityCounit :: forall (a :: MONOID m). Ob a => (Dual a ** a) ~> (Unit :: MONOID m) Source Github #

(IsoMix j, IsoMix k) => IsoMix (j, k) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.IsoMix

Methods

dualUnit :: Dual (Unit :: (j, k)) ~> (Unit :: (j, k)) Source Github #

dualUnitInv :: (Unit :: (j, k)) ~> Dual (Unit :: (j, k)) Source Github #

dualityCounit :: forall (a :: (j, k)). Ob a => (Dual a ** a) ~> (Unit :: (j, k)) Source Github #

Elems IsoMixStructures cs => IsoMix (FREE cs p) Source Github # 
Instance details

Defined in Proarrow.Category.Monoidal.IsoMix

Methods

dualUnit :: Dual (Unit :: FREE cs p) ~> (Unit :: FREE cs p) Source Github #

dualUnitInv :: (Unit :: FREE cs p) ~> Dual (Unit :: FREE cs p) Source Github #

dualityCounit :: forall (a :: FREE cs p). Ob a => (Dual a ** a) ~> (Unit :: FREE cs p) Source Github #

dualityCounitDefault :: forall {k} (a :: k). (IsoMix k, Ob a) => (Dual a ** a) ~> (Unit :: k) Source Github #

dualityCounit from the dialogue structure: into the unit of par, then dualUnit.

type IsoMixStructures = '[Monoidal, SymMonoidal, Dialogue, IsoMix] Source Github #

The structures the free category needs for IsoMix, and those its laws are stated for.