| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Proarrow.Category.Instance.Cost
Description
The Lawvere cost category: extended natural numbers ( or C nINF) as a thin category
with an arrow a exactly when ~> ba >= b (GTE). Addition of costs provides a symmetric
monoidal structure with as unit (and terminal object; C 0INF is initial), so categories
enriched in COST are generalized (Lawvere) metric spaces.
Documentation
Instances
| Quantale COST Source Github # | Costs: the tensor is addition, the join the minimum. Distances are compared with | ||||||||||||||||
Defined in Proarrow.Category.Enriched.Quantale | |||||||||||||||||
| Monoidal COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Associated Types
Methods withOb2 :: forall (a :: COST) (b :: COST) r. (Ob a, Ob b) => (Ob (a ** b) => r) -> r Source Github # leftUnitor :: forall (a :: COST). Ob a => ((Unit :: COST) ** a) ~> a Source Github # leftUnitorInv :: forall (a :: COST). Ob a => a ~> ((Unit :: COST) ** a) Source Github # rightUnitor :: forall (a :: COST). Ob a => (a ** (Unit :: COST)) ~> a Source Github # rightUnitorInv :: forall (a :: COST). Ob a => a ~> (a ** (Unit :: COST)) Source Github # associator :: forall (a :: COST) (b :: COST) (c :: COST). (Ob a, Ob b, Ob c) => ((a ** b) ** c) ~> (a ** (b ** c)) Source Github # associatorInv :: forall (a :: COST) (b :: COST) (c :: COST). (Ob a, Ob b, Ob c) => (a ** (b ** c)) ~> ((a ** b) ** c) Source Github # | |||||||||||||||||
| SymMonoidal COST Source Github # | |||||||||||||||||
| Distributive COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Methods distL :: forall (a :: COST) (b :: COST) (c :: COST). (Ob a, Ob b, Ob c) => (a ** (b || c)) ~> ((a ** b) || (a ** c)) Source Github # distR :: forall (a :: COST) (b :: COST) (c :: COST). (Ob a, Ob b, Ob c) => ((a || b) ** c) ~> ((a ** c) || (b ** c)) Source Github # absorbL :: forall (a :: COST). Ob a => (a ** (InitialObject :: COST)) ~> (InitialObject :: COST) Source Github # absorbR :: forall (a :: COST). Ob a => ((InitialObject :: COST) ** a) ~> (InitialObject :: COST) Source Github # | |||||||||||||||||
| HasEpiMonoFactorization COST Source Github # | |||||||||||||||||
| HasBinaryCoproducts COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Associated Types
Methods withObCoprod :: forall (a :: COST) (b :: COST) r. (Ob a, Ob b) => (Ob (a || b) => r) -> r Source Github # lft :: forall (a :: COST) (b :: COST). (Ob a, Ob b) => a ~> (a || b) Source Github # rgt :: forall (a :: COST) (b :: COST). (Ob a, Ob b) => b ~> (a || b) Source Github # (|||) :: forall (x :: COST) (a :: COST) (y :: COST). (x ~> a) -> (y ~> a) -> (x || y) ~> a Source Github # (+++) :: forall (a :: COST) (b :: COST) (x :: COST) (y :: COST). (a ~> x) -> (b ~> y) -> (a || b) ~> (x || y) Source Github # | |||||||||||||||||
| HasCoequalizers COST Source Github # | Dual to the | ||||||||||||||||
| HasInitialObject COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Associated Types
| |||||||||||||||||
| HasPushouts COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| CategoryOf COST Source Github # | Cost category. Categories enriched in the cost category are lawvere metric spaces. | ||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Associated Types
| |||||||||||||||||
| HasBinaryProducts COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Associated Types
Methods withObProd :: forall (a :: COST) (b :: COST) r. (Ob a, Ob b) => (Ob (a && b) => r) -> r Source Github # fst :: forall (a :: COST) (b :: COST). (Ob a, Ob b) => (a && b) ~> a Source Github # snd :: forall (a :: COST) (b :: COST). (Ob a, Ob b) => (a && b) ~> b Source Github # (&&&) :: forall (a :: COST) (x :: COST) (y :: COST). (a ~> x) -> (a ~> y) -> a ~> (x && y) Source Github # (***) :: forall (a :: COST) (b :: COST) (x :: COST) (y :: COST). (a ~> x) -> (b ~> y) -> (a && b) ~> (x && y) Source Github # | |||||||||||||||||
| HasEqualizers COST Source Github # |
| ||||||||||||||||
| HasPullbacks COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Methods pullback :: forall (o :: COST) (a :: COST) (b :: COST) r. (a ~> o) -> (b ~> o) -> (forall (p :: COST). (p ~> a) -> (p ~> b) -> r) -> r Source Github # factorPullback :: forall (a :: COST) (b :: COST) (p :: COST) (q :: COST). (p ~> a) -> (p ~> b) -> (q ~> a) -> (q ~> b) -> q ~> p Source Github # | |||||||||||||||||
| HasTerminalObject COST Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Associated Types
| |||||||||||||||||
| Promonad GTE Source Github # | |||||||||||||||||
| DecidableProfunctor GTE Source Github # | Decided by comparing the naturals; | ||||||||||||||||
| ThinProfunctor GTE Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| MonoidalProfunctor GTE Source Github # | |||||||||||||||||
| Profunctor GTE Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost Methods dimap :: forall (c :: COST) (a :: COST) (b :: COST) (d :: COST). (c ~> a) -> (b ~> d) -> GTE a b -> GTE c d Source Github # lmap :: forall (c :: COST) (a :: COST) (b :: COST). (c ~> a) -> GTE a b -> GTE c b Source Github # rmap :: forall (b :: COST) (d :: COST) (a :: COST). (b ~> d) -> GTE a b -> GTE a d Source Github # (\\) :: forall (a :: COST) (b :: COST) r. ((Ob a, Ob b) => r) -> GTE a b -> r Source Github # | |||||||||||||||||
| (SNatI n, EnrichedProfunctor COST p, Enriched COST k, Enumerable k) => EnrichedProfunctor COST (Walk n p :: k -> k -> Type) Source Github # | Walks along a | ||||||||||||||||
Defined in Proarrow.Category.Enriched.Thin.Composition Methods withProObj :: forall (a :: k) (b :: k) r. (Ob a, Ob b) => (Ob (ProObj COST (Walk n p) a b) => r) -> r Source Github # underlying :: forall (a :: k) (b :: k). Walk n p a b -> (Unit :: COST) ~> ProObj COST (Walk n p) a b Source Github # enriched :: forall (a :: k) (b :: k). (Ob a, Ob b) => ((Unit :: COST) ~> ProObj COST (Walk n p) a b) -> Walk n p a b Source Github # rmap :: forall (a :: k) (b :: k) (c :: k). (Ob a, Ob b, Ob c) => (HomObj COST b c ** ProObj COST (Walk n p) a b) ~> ProObj COST (Walk n p) a c Source Github # lmap :: forall (a :: k) (b :: k) (c :: k). (Ob a, Ob b, Ob c) => (HomObj COST c a ** ProObj COST (Walk n p) a b) ~> ProObj COST (Walk n p) c b Source Github # | |||||||||||||||||
| Indexed k => EnrichedProfunctor COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Discrete Methods withProObj :: forall (a :: DISCRETE k) (b :: DISCRETE k) r. (Ob a, Ob b) => (Ob (ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) a b) => r) -> r Source Github # underlying :: forall (a :: DISCRETE k) (b :: DISCRETE k). Discrete a b -> (Unit :: COST) ~> ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) a b Source Github # enriched :: forall (a :: DISCRETE k) (b :: DISCRETE k). (Ob a, Ob b) => ((Unit :: COST) ~> ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) a b) -> Discrete a b Source Github # rmap :: forall (a :: DISCRETE k) (b :: DISCRETE k) (c :: DISCRETE k). (Ob a, Ob b, Ob c) => (HomObj COST b c ** ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) a b) ~> ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) a c Source Github # lmap :: forall (a :: DISCRETE k) (b :: DISCRETE k) (c :: DISCRETE k). (Ob a, Ob b, Ob c) => (HomObj COST c a ** ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) a b) ~> ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) c b Source Github # | |||||||||||||||||
| (Indexed k, KnownEdges es) => EnrichedProfunctor COST (Edges es :: DISCRETE k -> DISCRETE k -> Type) Source Github # | A graph with | ||||||||||||||||
Defined in Proarrow.Profunctor.Instance.Edges Methods withProObj :: forall (a :: DISCRETE k) (b :: DISCRETE k) r. (Ob a, Ob b) => (Ob (ProObj COST (Edges es) a b) => r) -> r Source Github # underlying :: forall (a :: DISCRETE k) (b :: DISCRETE k). Edges es a b -> (Unit :: COST) ~> ProObj COST (Edges es) a b Source Github # enriched :: forall (a :: DISCRETE k) (b :: DISCRETE k). (Ob a, Ob b) => ((Unit :: COST) ~> ProObj COST (Edges es) a b) -> Edges es a b Source Github # rmap :: forall (a :: DISCRETE k) (b :: DISCRETE k) (c :: DISCRETE k). (Ob a, Ob b, Ob c) => (HomObj COST b c ** ProObj COST (Edges es) a b) ~> ProObj COST (Edges es) a c Source Github # lmap :: forall (a :: DISCRETE k) (b :: DISCRETE k) (c :: DISCRETE k). (Ob a, Ob b, Ob c) => (HomObj COST c a ** ProObj COST (Edges es) a b) ~> ProObj COST (Edges es) c b Source Github # | |||||||||||||||||
| type Unit Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type InitialObject Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type (~>) Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type TerminalObject Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type Ob (a :: COST) Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type 'INF ** (b :: COST) Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type (a :: COST) ** 'INF Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type 'INF || (b :: COST) Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type (a :: COST) || 'INF Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type 'INF && (b :: COST) Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type (a :: COST) && 'INF Source Github # | |||||||||||||||||
Defined in Proarrow.Category.Instance.Cost | |||||||||||||||||
| type HasArrow GTE (a :: COST) (b :: COST) Source Github # | |||||||||||||||||
| type Holds GTE 'INF (b :: COST) Source Github # | |||||||||||||||||
| type Holds GTE ('C a :: COST) 'INF Source Github # | |||||||||||||||||
| type Holds GTE ('C a :: COST) ('C b :: COST) Source Github # | |||||||||||||||||
| type ProObj COST (Walk n p :: k -> k -> Type) (a :: k) (b :: k) Source Github # | |||||||||||||||||
| type ('C a :: COST) ** ('C b :: COST) Source Github # | |||||||||||||||||
| type ('C a :: COST) || ('C b :: COST) Source Github # | |||||||||||||||||
| type ('C a :: COST) && ('C b :: COST) Source Github # | |||||||||||||||||
| type ProObj COST (Discrete :: DISCRETE k -> DISCRETE k -> Type) (a :: DISCRETE k) (b :: DISCRETE k) Source Github # | |||||||||||||||||
| type ProObj COST (Edges es :: DISCRETE k -> DISCRETE k -> Type) (a :: DISCRETE k) (b :: DISCRETE k) Source Github # | |||||||||||||||||
data GTE (a :: COST) (b :: COST) where Source Github #
Constructors
| Inf :: forall (b :: COST). Ob b => GTE 'INF b | |
| GTE :: forall (a1 :: Nat) (b1 :: Nat). (KnownNat a1, KnownNat b1, b1 <= a1) => GTE ('C a1) ('C b1) |
Instances
| Promonad GTE Source Github # | |
| DecidableProfunctor GTE Source Github # | Decided by comparing the naturals; |
| ThinProfunctor GTE Source Github # | |
Defined in Proarrow.Category.Instance.Cost | |
| MonoidalProfunctor GTE Source Github # | |
| Profunctor GTE Source Github # | |
Defined in Proarrow.Category.Instance.Cost Methods dimap :: forall (c :: COST) (a :: COST) (b :: COST) (d :: COST). (c ~> a) -> (b ~> d) -> GTE a b -> GTE c d Source Github # lmap :: forall (c :: COST) (a :: COST) (b :: COST). (c ~> a) -> GTE a b -> GTE c b Source Github # rmap :: forall (b :: COST) (d :: COST) (a :: COST). (b ~> d) -> GTE a b -> GTE a d Source Github # (\\) :: forall (a :: COST) (b :: COST) r. ((Ob a, Ob b) => r) -> GTE a b -> r Source Github # | |
| type HasArrow GTE (a :: COST) (b :: COST) Source Github # | |
| type Holds GTE 'INF (b :: COST) Source Github # | |
| type Holds GTE ('C a :: COST) 'INF Source Github # | |
| type Holds GTE ('C a :: COST) ('C b :: COST) Source Github # | |
lteTrans :: forall (a :: Nat) (b :: Nat) (c :: Nat) r. (a <= b, b <= c, KnownNat a, KnownNat c) => (a <= c => r) -> r Source Github #
plusMonotone :: forall (a :: Nat) (b :: Nat) (c :: Natural) (d :: Natural) r. (a <= b, c <= d, KnownNat (a + c), KnownNat (b + d)) => ((a + c) <= (b + d) => r) -> r Source Github #
withPlusIsNat :: forall (a :: Nat) (b :: Nat) r. (KnownNat a, KnownNat b) => (KnownNat (a + b) => r) -> r Source Github #