packages feed

constrained-categories 0.1.0.0 → 0.2.0.0

raw patch · 3 files changed

+48/−48 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Control.Arrow.Constrained: class (Morphism k, HasProxy k) => CartesianProxy k
- Control.Arrow.Constrained: class (HasProxy k, ProxyVal k a x ~ p a x) => PointProxy p k a x | p -> k
- Control.Arrow.Constrained: genericProxyCombine :: (HasProxy k, PreArrow k, Object k a, ObjectPair k b c, Object k d) => k (b, c) d -> GenericProxy k a b -> GenericProxy k a c -> GenericProxy k a d
- Control.Category.Constrained: GenericProxy :: k a v -> GenericProxy k a v
- Control.Category.Constrained: class Category k => HasProxy k where type family ProxyVal k a v :: * type instance ProxyVal k a v = GenericProxy k a v
- Control.Category.Constrained: data GenericProxy k a v
- Control.Category.Constrained: genericProxyMap :: (HasProxy k, Object k a, Object k b, Object k c) => k b c -> GenericProxy k a b -> GenericProxy k a c
- Control.Category.Constrained: instance HasProxy (->)
- Control.Category.Constrained: runGenericProxy :: GenericProxy k a v -> k a v
+ Control.Arrow.Constrained: class (Morphism k, HasAgent k) => CartesianAgent k
+ Control.Arrow.Constrained: class (HasAgent k, AgentVal k a x ~ p a x) => PointAgent p k a x | p -> k
+ Control.Arrow.Constrained: genericAgentCombine :: (HasAgent k, PreArrow k, Object k a, ObjectPair k b c, Object k d) => k (b, c) d -> GenericAgent k a b -> GenericAgent k a c -> GenericAgent k a d
+ Control.Category.Constrained: GenericAgent :: k a v -> GenericAgent k a v
+ Control.Category.Constrained: class Category k => HasAgent k where type family AgentVal k a v :: * type instance AgentVal k a v = GenericAgent k a v
+ Control.Category.Constrained: data GenericAgent k a v
+ Control.Category.Constrained: genericAgentMap :: (HasAgent k, Object k a, Object k b, Object k c) => k b c -> GenericAgent k a b -> GenericAgent k a c
+ Control.Category.Constrained: instance HasAgent (->)
+ Control.Category.Constrained: runGenericAgent :: GenericAgent k a v -> k a v
- Control.Arrow.Constrained: alg1to2 :: (CartesianProxy k, Object k a, ObjectPair k b c) => (forall q. Object k q => ProxyVal k q a -> (ProxyVal k q b, ProxyVal k q c)) -> k a (b, c)
+ Control.Arrow.Constrained: alg1to2 :: (CartesianAgent k, Object k a, ObjectPair k b c) => (forall q. Object k q => AgentVal k q a -> (AgentVal k q b, AgentVal k q c)) -> k a (b, c)
- Control.Arrow.Constrained: alg2to1 :: (CartesianProxy k, ObjectPair k a b, Object k c) => (forall q. Object k q => ProxyVal k q a -> ProxyVal k q b -> ProxyVal k q c) -> k (a, b) c
+ Control.Arrow.Constrained: alg2to1 :: (CartesianAgent k, ObjectPair k a b, Object k c) => (forall q. Object k q => AgentVal k q a -> AgentVal k q b -> AgentVal k q c) -> k (a, b) c
- Control.Arrow.Constrained: alg2to2 :: (CartesianProxy k, ObjectPair k a b, ObjectPair k c d) => (forall q. Object k q => ProxyVal k q a -> ProxyVal k q b -> (ProxyVal k q c, ProxyVal k q d)) -> k (a, b) (c, d)
+ Control.Arrow.Constrained: alg2to2 :: (CartesianAgent k, ObjectPair k a b, ObjectPair k c d) => (forall q. Object k q => AgentVal k q a -> AgentVal k q b -> (AgentVal k q c, AgentVal k q d)) -> k (a, b) (c, d)
- Control.Arrow.Constrained: genericAlg1to2 :: (PreArrow k, u ~ UnitObject k, Object k a, ObjectPair k b c) => (forall q. Object k q => GenericProxy k q a -> (GenericProxy k q b, GenericProxy k q c)) -> k a (b, c)
+ Control.Arrow.Constrained: genericAlg1to2 :: (PreArrow k, u ~ UnitObject k, Object k a, ObjectPair k b c) => (forall q. Object k q => GenericAgent k q a -> (GenericAgent k q b, GenericAgent k q c)) -> k a (b, c)
- Control.Arrow.Constrained: genericAlg2to1 :: (PreArrow k, u ~ UnitObject k, ObjectPair k a u, ObjectPair k a b, ObjectPair k b u, ObjectPair k b a) => (forall q. Object k q => GenericProxy k q a -> GenericProxy k q b -> GenericProxy k q c) -> k (a, b) c
+ Control.Arrow.Constrained: genericAlg2to1 :: (PreArrow k, u ~ UnitObject k, ObjectPair k a u, ObjectPair k a b, ObjectPair k b u, ObjectPair k b a) => (forall q. Object k q => GenericAgent k q a -> GenericAgent k q b -> GenericAgent k q c) -> k (a, b) c
- Control.Arrow.Constrained: genericAlg2to2 :: (PreArrow k, u ~ UnitObject k, ObjectPair k a u, ObjectPair k a b, ObjectPair k c d, ObjectPair k b u, ObjectPair k b a) => (forall q. Object k q => GenericProxy k q a -> GenericProxy k q b -> (GenericProxy k q c, GenericProxy k q d)) -> k (a, b) (c, d)
+ Control.Arrow.Constrained: genericAlg2to2 :: (PreArrow k, u ~ UnitObject k, ObjectPair k a u, ObjectPair k a b, ObjectPair k c d, ObjectPair k b u, ObjectPair k b a) => (forall q. Object k q => GenericAgent k q a -> GenericAgent k q b -> (GenericAgent k q c, GenericAgent k q d)) -> k (a, b) (c, d)
- Control.Arrow.Constrained: genericPoint :: (WellPointed k, Object k a, ObjectPoint k x) => x -> GenericProxy k a x
+ Control.Arrow.Constrained: genericPoint :: (WellPointed k, Object k a, ObjectPoint k x) => x -> GenericAgent k a x
- Control.Arrow.Constrained: genericUnit :: (PreArrow k, HasProxy k, Object k a) => GenericProxy k a (UnitObject k)
+ Control.Arrow.Constrained: genericUnit :: (PreArrow k, HasAgent k, Object k a) => GenericAgent k a (UnitObject k)
- Control.Arrow.Constrained: point :: (PointProxy p k a x, Object k a, Object k x) => x -> p a x
+ Control.Arrow.Constrained: point :: (PointAgent p k a x, Object k a, Object k x) => x -> p a x
- Control.Category.Constrained: ($~) :: (HasProxy k, Object k a, Object k b, Object k c) => k b c -> ProxyVal k a b -> ProxyVal k a c
+ Control.Category.Constrained: ($~) :: (HasAgent k, Object k a, Object k b, Object k c) => k b c -> AgentVal k a b -> AgentVal k a c
- Control.Category.Constrained: alg :: (HasProxy k, Object k a, Object k b) => (forall q. Object k q => ProxyVal k q a -> ProxyVal k q b) -> k a b
+ Control.Category.Constrained: alg :: (HasAgent k, Object k a, Object k b) => (forall q. Object k q => AgentVal k q a -> AgentVal k q b) -> k a b
- Control.Category.Constrained: genericAlg :: (HasProxy k, Object k a, Object k b) => (forall q. Object k q => GenericProxy k q a -> GenericProxy k q b) -> k a b
+ Control.Category.Constrained: genericAlg :: (HasAgent k, Object k a, Object k b) => (forall q. Object k q => GenericAgent k q a -> GenericAgent k q b) -> k a b

Files

Control/Arrow/Constrained.hs view
@@ -53,9 +53,9 @@     -- * Alternative composition notation     , (>>>), (<<<)     -- * Proxies for cartesian categories-    , CartesianProxy(..)-    , genericProxyCombine, genericUnit, genericAlg1to2, genericAlg2to1, genericAlg2to2-    , PointProxy(..), genericPoint+    , CartesianAgent(..)+    , genericAgentCombine, genericUnit, genericAlg1to2, genericAlg2to1, genericAlg2to2+    , PointAgent(..), genericPoint     -- * Misc utility     -- ** Conditionals     , choose, ifThenElse@@ -365,60 +365,60 @@    -genericProxyCombine :: ( HasProxy k, PreArrow k+genericAgentCombine :: ( HasAgent k, PreArrow k                        , Object k a, ObjectPair k b c, Object k d )-     => k (b,c) d -> GenericProxy k a b -> GenericProxy k a c -> GenericProxy k a d-genericProxyCombine m (GenericProxy v) (GenericProxy w)-       = GenericProxy $ m . (v &&& w)+     => k (b,c) d -> GenericAgent k a b -> GenericAgent k a c -> GenericAgent k a d+genericAgentCombine m (GenericAgent v) (GenericAgent w)+       = GenericAgent $ m . (v &&& w)   -genericUnit :: ( PreArrow k, HasProxy k, Object k a )-        => GenericProxy k a (UnitObject k)-genericUnit = GenericProxy terminal+genericUnit :: ( PreArrow k, HasAgent k, Object k a )+        => GenericAgent k a (UnitObject k)+genericUnit = GenericAgent terminal  -class (Morphism k, HasProxy k) => CartesianProxy k where+class (Morphism k, HasAgent k) => CartesianAgent k where   alg1to2 :: ( Object k a, ObjectPair k b c           ) => (forall q . Object k q-                 => ProxyVal k q a -> (ProxyVal k q b, ProxyVal k q c) )+                 => AgentVal k q a -> (AgentVal k q b, AgentVal k q c) )                -> k a (b,c)   alg2to1 :: ( ObjectPair k a b, Object k c           ) => (forall q . Object k q-                 => ProxyVal k q a -> ProxyVal k q b -> ProxyVal k q c )+                 => AgentVal k q a -> AgentVal k q b -> AgentVal k q c )                -> k (a,b) c   alg2to2 :: ( ObjectPair k a b, ObjectPair k c d           ) => (forall q . Object k q-                 => ProxyVal k q a -> ProxyVal k q b -> (ProxyVal k q c, ProxyVal k q d) )+                 => AgentVal k q a -> AgentVal k q b -> (AgentVal k q c, AgentVal k q d) )                -> k (a,b) (c,d)  genericAlg1to2 :: ( PreArrow k, u ~ UnitObject k                   , Object k a, ObjectPair k b c                   ) => ( forall q . Object k q-                      => GenericProxy k q a -> (GenericProxy k q b, GenericProxy k q c) )+                      => GenericAgent k q a -> (GenericAgent k q b, GenericAgent k q c) )                -> k a (b,c)-genericAlg1to2 f = runGenericProxy b &&& runGenericProxy c- where (b,c) = f $ GenericProxy id+genericAlg1to2 f = runGenericAgent b &&& runGenericAgent c+ where (b,c) = f $ GenericAgent id genericAlg2to1 :: ( PreArrow k, u ~ UnitObject k                   , ObjectPair k a u, ObjectPair k a b, ObjectPair k b u, ObjectPair k b a                   ) => ( forall q . Object k q-                      => GenericProxy k q a -> GenericProxy k q b -> GenericProxy k q c )+                      => GenericAgent k q a -> GenericAgent k q b -> GenericAgent k q c )                -> k (a,b) c-genericAlg2to1 f = runGenericProxy $ f (GenericProxy fst) (GenericProxy snd)+genericAlg2to1 f = runGenericAgent $ f (GenericAgent fst) (GenericAgent snd) genericAlg2to2 :: ( PreArrow k, u ~ UnitObject k                   , ObjectPair k a u, ObjectPair k a b, ObjectPair k c d                   , ObjectPair k b u, ObjectPair k b a                   ) => ( forall q . Object k q-                      => GenericProxy k q a -> GenericProxy k q b -                         -> (GenericProxy k q c, GenericProxy k q d) )+                      => GenericAgent k q a -> GenericAgent k q b +                         -> (GenericAgent k q c, GenericAgent k q d) )                -> k (a,b) (c,d)-genericAlg2to2 f = runGenericProxy c &&& runGenericProxy d- where (c,d) = f (GenericProxy fst) (GenericProxy snd)+genericAlg2to2 f = runGenericAgent c &&& runGenericAgent d+ where (c,d) = f (GenericAgent fst) (GenericAgent snd)  -class (HasProxy k, ProxyVal k a x ~ p a x) -           => PointProxy p k a x | p -> k where+class (HasAgent k, AgentVal k a x ~ p a x) +           => PointAgent p k a x | p -> k where   point :: (Object k a, Object k x) => x -> p a x  genericPoint :: ( WellPointed k, Object k a, ObjectPoint k x )-       => x -> GenericProxy k a x-genericPoint x = GenericProxy $ const x+       => x -> GenericAgent k a x+genericPoint x = GenericAgent $ const x 
Control/Category/Constrained.hs view
@@ -31,9 +31,9 @@           , ConstrainedCategory (ConstrainedMorphism)           , constrained, unconstrained             -- * Global-element proxies-          , HasProxy (..)-          , genericAlg, genericProxyMap-          , GenericProxy (..)+          , HasAgent (..)+          , genericAlg, genericAgentMap+          , GenericAgent (..)             -- * Utility           , inCategoryOf           , CatTagged@@ -362,39 +362,39 @@  infixr 0 $~ --- | A proxy value is a \"general representation\" of a category's+-- | An agent value is a \"general representation\" of a category's --   values, i.e. /global elements/. This is useful to define certain --   morphisms (including ones that can't just \"inherit\" from '->' --   with 'Control.Arrow.Constrained.arr') in ways other than point-free --   composition pipelines. Instead, you can write algebraic expressions --   much as if dealing with actual values of your category's objects,---   but using the proxy type which is restricted so any function+--   but using the agent type which is restricted so any function --   defined as such a lambda-expression qualifies as a morphism  --   of that category.-class (Category k) => HasProxy k where-  type ProxyVal k a v :: *-  type ProxyVal k a v = GenericProxy k a v+class (Category k) => HasAgent k where+  type AgentVal k a v :: *+  type AgentVal k a v = GenericAgent k a v   alg :: ( Object k a, Object k b          ) => (forall q . Object k q-                 => ProxyVal k q a -> ProxyVal k q b) -> k a b+                 => AgentVal k q a -> AgentVal k q b) -> k a b   ($~) :: ( Object k a, Object k b, Object k c -          ) => k b c -> ProxyVal k a b -> ProxyVal k a c+          ) => k b c -> AgentVal k a b -> AgentVal k a c -data GenericProxy k a v = GenericProxy { runGenericProxy :: k a v }+data GenericAgent k a v = GenericAgent { runGenericAgent :: k a v } -genericAlg :: ( HasProxy k, Object k a, Object k b )+genericAlg :: ( HasAgent k, Object k a, Object k b )         => ( forall q . Object k q-             => GenericProxy k q a -> GenericProxy k q b ) -> k a b-genericAlg f = runGenericProxy . f $ GenericProxy id+             => GenericAgent k q a -> GenericAgent k q b ) -> k a b+genericAlg f = runGenericAgent . f $ GenericAgent id -genericProxyMap :: ( HasProxy k, Object k a, Object k b, Object k c )-        => k b c -> GenericProxy k a b -> GenericProxy k a c-genericProxyMap m (GenericProxy v) = GenericProxy $ m . v+genericAgentMap :: ( HasAgent k, Object k a, Object k b, Object k c )+        => k b c -> GenericAgent k a b -> GenericAgent k a c+genericAgentMap m (GenericAgent v) = GenericAgent $ m . v   -instance HasProxy (->) where-  type ProxyVal (->) a b = b+instance HasAgent (->) where+  type AgentVal (->) a b = b   alg f = f   ($~) = ($) 
constrained-categories.cabal view
@@ -1,5 +1,5 @@ Name:                constrained-categories-Version:             0.1.0.0+Version:             0.2.0.0 Category:            control Synopsis:            Constrained clones of the category-theory type classes, using ConstraintKinds. Description:         Haskell has, and makes great use of, powerful facilities from category@@ -27,7 +27,7 @@ License:             GPL-3 License-file:        COPYING Author:              Justus Sagemüller-Maintainer:          (@) sagemuej $ smail.uni-koeln.de+Maintainer:          (@) sagemueller $ geo.uni-koeln.de Homepage:            https://github.com/leftaroundabout/constrained-categories Build-Type:          Simple Cabal-Version:       >=1.10