categories 1.0.6 → 1.0.7
raw patch · 4 files changed
+72/−25 lines, 4 filesdep ~basePVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: base
API changes (from Hackage documentation)
- Control.Categorical.Functor: instance (Typeable1 f, Data (f a), Data a) => Data (LiftedFunctor f a)
- Control.Categorical.Functor: instance (Typeable1 f, Data (f a), Data a) => Data (LoweredFunctor f a)
- Control.Categorical.Functor: instance Typeable1 f => Typeable1 (LiftedFunctor f)
- Control.Categorical.Functor: instance Typeable1 f => Typeable1 (LoweredFunctor f)
- Control.Category.Dual: instance (Typeable2 k, Data a, Data b, Data (k b a)) => Data (Dual k a b)
- Control.Category.Dual: instance Typeable2 k => Typeable2 (Dual k)
+ Control.Categorical.Functor: instance (Typeable f, Data (f a), Data a) => Data (LiftedFunctor f a)
+ Control.Categorical.Functor: instance (Typeable f, Data (f a), Data a) => Data (LoweredFunctor f a)
+ Control.Categorical.Functor: instance Typeable LiftedFunctor
+ Control.Categorical.Functor: instance Typeable LoweredFunctor
+ Control.Category.Dual: instance (Typeable k, Data a, Data b, Data (k b a)) => Data (Dual k a b)
+ Control.Category.Dual: instance Typeable Dual
- Control.Categorical.Object: initiate :: HasInitialObject k => Initial k k a
+ Control.Categorical.Object: initiate :: HasInitialObject k => Initial k `k` a
- Control.Categorical.Object: terminate :: HasTerminalObject k => a k Terminal k
+ Control.Categorical.Object: terminate :: HasTerminalObject k => a `k` Terminal k
- Control.Category.Cartesian: (&&&) :: Cartesian k => (a k b) -> (a k c) -> a k Product k b c
+ Control.Category.Cartesian: (&&&) :: Cartesian k => (a `k` b) -> (a `k` c) -> a `k` Product k b c
- Control.Category.Cartesian: (|||) :: CoCartesian k => k a c -> k b c -> Sum k a b k c
+ Control.Category.Cartesian: (|||) :: CoCartesian k => k a c -> k b c -> Sum k a b `k` c
- Control.Category.Cartesian: associateProduct :: Cartesian k => Product k (Product k a b) c k Product k a (Product k b c)
+ Control.Category.Cartesian: associateProduct :: Cartesian k => Product k (Product k a b) c `k` Product k a (Product k b c)
- Control.Category.Cartesian: associateSum :: CoCartesian k => Sum k (Sum k a b) c k Sum k a (Sum k b c)
+ Control.Category.Cartesian: associateSum :: CoCartesian k => Sum k (Sum k a b) c `k` Sum k a (Sum k b c)
- Control.Category.Cartesian: bimapProduct :: Cartesian k => k a c -> k b d -> Product k a b k Product k c d
+ Control.Category.Cartesian: bimapProduct :: Cartesian k => k a c -> k b d -> Product k a b `k` Product k c d
- Control.Category.Cartesian: bimapSum :: CoCartesian k => k a c -> k b d -> Sum k a b k Sum k c d
+ Control.Category.Cartesian: bimapSum :: CoCartesian k => k a c -> k b d -> Sum k a b `k` Sum k c d
- Control.Category.Cartesian: braidSum :: CoCartesian k => Sum k a b k Sum k b a
+ Control.Category.Cartesian: braidSum :: CoCartesian k => Sum k a b `k` Sum k b a
- Control.Category.Cartesian: codiag :: CoCartesian k => Sum k a a k a
+ Control.Category.Cartesian: codiag :: CoCartesian k => Sum k a a `k` a
- Control.Category.Cartesian: diag :: Cartesian k => a k Product k a a
+ Control.Category.Cartesian: diag :: Cartesian k => a `k` Product k a a
- Control.Category.Cartesian: disassociateProduct :: Cartesian k => Product k a (Product k b c) k Product k (Product k a b) c
+ Control.Category.Cartesian: disassociateProduct :: Cartesian k => Product k a (Product k b c) `k` Product k (Product k a b) c
- Control.Category.Cartesian: disassociateSum :: CoCartesian k => Sum k a (Sum k b c) k Sum k (Sum k a b) c
+ Control.Category.Cartesian: disassociateSum :: CoCartesian k => Sum k a (Sum k b c) `k` Sum k (Sum k a b) c
- Control.Category.Cartesian: fst :: Cartesian k => Product k a b k a
+ Control.Category.Cartesian: fst :: Cartesian k => Product k a b `k` a
- Control.Category.Cartesian: inl :: CoCartesian k => a k Sum k a b
+ Control.Category.Cartesian: inl :: CoCartesian k => a `k` Sum k a b
- Control.Category.Cartesian: inr :: CoCartesian k => b k Sum k a b
+ Control.Category.Cartesian: inr :: CoCartesian k => b `k` Sum k a b
- Control.Category.Cartesian: snd :: Cartesian k => Product k a b k b
+ Control.Category.Cartesian: snd :: Cartesian k => Product k a b `k` b
- Control.Category.Cartesian.Closed: apply :: CCC k => Product k (Exp k a b) a k b
+ Control.Category.Cartesian.Closed: apply :: CCC k => Product k (Exp k a b) a `k` b
- Control.Category.Cartesian.Closed: coapply :: CoCCC k => b k Sum k (Coexp k a b) a
+ Control.Category.Cartesian.Closed: coapply :: CoCCC k => b `k` Sum k (Coexp k a b) a
- Control.Category.Cartesian.Closed: cocurry :: CoCCC k => c k Sum k a b -> Coexp k b c k a
+ Control.Category.Cartesian.Closed: cocurry :: CoCCC k => c `k` Sum k a b -> Coexp k b c `k` a
- Control.Category.Cartesian.Closed: counitCCC :: CCC k => Product k b (Exp k b a) k a
+ Control.Category.Cartesian.Closed: counitCCC :: CCC k => Product k b (Exp k b a) `k` a
- Control.Category.Cartesian.Closed: counitCoCCC :: CoCCC k => Coexp k b (Sum k b a) k a
+ Control.Category.Cartesian.Closed: counitCoCCC :: CoCCC k => Coexp k b (Sum k b a) `k` a
- Control.Category.Cartesian.Closed: curry :: CCC k => Product k a b k c -> a k Exp k b c
+ Control.Category.Cartesian.Closed: curry :: CCC k => Product k a b `k` c -> a `k` Exp k b c
- Control.Category.Cartesian.Closed: uncocurry :: CoCCC k => Coexp k b c k a -> c k Sum k a b
+ Control.Category.Cartesian.Closed: uncocurry :: CoCCC k => Coexp k b c `k` a -> c `k` Sum k a b
- Control.Category.Cartesian.Closed: uncurry :: CCC k => a k Exp k b c -> Product k a b k c
+ Control.Category.Cartesian.Closed: uncurry :: CCC k => a `k` Exp k b c -> Product k a b `k` c
- Control.Category.Cartesian.Closed: unitCCC :: CCC k => a k Exp k b (Product k b a)
+ Control.Category.Cartesian.Closed: unitCCC :: CCC k => a `k` Exp k b (Product k b a)
- Control.Category.Cartesian.Closed: unitCoCCC :: CoCCC k => a k Sum k b (Coexp k b a)
+ Control.Category.Cartesian.Closed: unitCoCCC :: CoCCC k => a `k` Sum k b (Coexp k b a)
- Control.Category.Distributive: distribute :: Distributive k => Product k a (Sum k b c) k Sum k (Product k a b) (Product k a c)
+ Control.Category.Distributive: distribute :: Distributive k => Product k a (Sum k b c) `k` Sum k (Product k a b) (Product k a c)
- Control.Category.Distributive: factor :: (Cartesian k, CoCartesian k) => Sum k (Product k a b) (Product k a c) k Product k a (Sum k b c)
+ Control.Category.Distributive: factor :: (Cartesian k, CoCartesian k) => Sum k (Product k a b) (Product k a c) `k` Product k a (Sum k b c)
Files
- CHANGELOG.markdown +4/−0
- categories.cabal +3/−3
- src/Control/Categorical/Functor.hs +46/−19
- src/Control/Category/Dual.hs +19/−3
CHANGELOG.markdown view
@@ -1,3 +1,7 @@+1.0.7+-----+* Build fixes for GHC 7.8.x to support the current version of `Typeable`+ 1.0.6 ----- * Marked modules `Trustworthy`
categories.cabal view
@@ -1,6 +1,6 @@ name: categories category: Control-version: 1.0.6+version: 1.0.7 license: BSD3 cabal-version: >= 1.10 license-file: LICENSE@@ -10,10 +10,10 @@ homepage: http://github.com/ekmett/categories bug-reports: http://github.com/ekmett/categories/issues synopsis: Categories-copyright: Copyright (C) 2008-2010, Edward A. Kmett+copyright: Copyright (C) 2008-2014, Edward A. Kmett description: Categories build-type: Simple-tested-with: GHC == 7.4.1, GHC == 7.6.1+tested-with: GHC == 7.4.1, GHC == 7.6.1, GHC == 7.8.3 extra-source-files: .ghci .gitignore
src/Control/Categorical/Functor.hs view
@@ -1,8 +1,11 @@ {-# LANGUAGE CPP #-}-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+#if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleContexts, UndecidableInstances, FlexibleInstances #-}+#if __GLASGOW_HASKELL__ >= 708+{-# LANGUAGE DeriveDataTypeable #-}+#endif ------------------------------------------------------------------------------------------- -- | -- Module : Control.Categorical.Functor@@ -31,26 +34,28 @@ import qualified Prelude #ifdef __GLASGOW_HASKELL__ import Data.Data (Data(..), mkDataType, DataType, mkConstr, Constr, constrIndex, Fixity(..))+#if __GLASGOW_HASKELL__ < 708 #if MIN_VERSION_base(4,4,0) import Data.Typeable (Typeable1(..), TyCon, mkTyCon3, mkTyConApp, gcast1) #else import Data.Typeable (Typeable1(..), TyCon, mkTyCon, mkTyConApp, gcast1) #endif+#else+import Data.Typeable (Typeable, gcast1) #endif+#endif -- TODO Data, Typeable-newtype LiftedFunctor f a = LiftedFunctor (f a) deriving (Show, Read)+newtype LiftedFunctor f a = LiftedFunctor (f a) deriving+ ( Show+ , Read+#if __GLASGOW_HASKELL__ >= 708+ , Typeable+#endif+ ) #ifdef __GLASGOW_HASKELL__ -liftedTyCon :: TyCon-#if MIN_VERSION_base(4,4,0)-liftedTyCon = mkTyCon3 "categories" "Control.Categorical.Functor" "LiftedFunctor"-#else-liftedTyCon = mkTyCon "Control.Categorical.Functor.LiftedFunctor"-#endif-{-# NOINLINE liftedTyCon #-}- liftedConstr :: Constr liftedConstr = mkConstr liftedDataType "LiftedFunctor" [] Prefix {-# NOINLINE liftedConstr #-}@@ -59,11 +64,24 @@ liftedDataType = mkDataType "Control.Categorical.Fucntor.LiftedFunctor" [liftedConstr] {-# NOINLINE liftedDataType #-} +#if __GLASGOW_HASKELL__ < 708 instance Typeable1 f => Typeable1 (LiftedFunctor f) where typeOf1 tfa = mkTyConApp liftedTyCon [typeOf1 (undefined `asArgsType` tfa)] where asArgsType :: f a -> t f a -> f a asArgsType = const +liftedTyCon :: TyCon+#if MIN_VERSION_base(4,4,0)+liftedTyCon = mkTyCon3 "categories" "Control.Categorical.Functor" "LiftedFunctor"+#else+liftedTyCon = mkTyCon "Control.Categorical.Functor.LiftedFunctor"+#endif+{-# NOINLINE liftedTyCon #-}++#else+#define Typeable1 Typeable+#endif+ instance (Typeable1 f, Data (f a), Data a) => Data (LiftedFunctor f a) where gfoldl f z (LiftedFunctor a) = z LiftedFunctor `f` a toConstr _ = liftedConstr@@ -74,18 +92,16 @@ dataCast1 f = gcast1 f #endif -newtype LoweredFunctor f a = LoweredFunctor (f a) deriving (Show, Read)+newtype LoweredFunctor f a = LoweredFunctor (f a) deriving+ ( Show+ , Read+#if __GLASGOW_HASKELL__ >= 708+ , Typeable+#endif+ ) #ifdef __GLASGOW_HASKELL__ -loweredTyCon :: TyCon-#if MIN_VERSION_base(4,4,0)-loweredTyCon = mkTyCon3 "categories" "Control.Categorical.Functor" "LoweredFunctor"-#else-loweredTyCon = mkTyCon "Control.Categorical.Functor.LoweredFunctor"-#endif-{-# NOINLINE loweredTyCon #-}- loweredConstr :: Constr loweredConstr = mkConstr loweredDataType "LoweredFunctor" [] Prefix {-# NOINLINE loweredConstr #-}@@ -94,10 +110,21 @@ loweredDataType = mkDataType "Control.Categorical.Fucntor.LoweredFunctor" [loweredConstr] {-# NOINLINE loweredDataType #-} +#if __GLASGOW_HASKELL__ < 708 instance Typeable1 f => Typeable1 (LoweredFunctor f) where typeOf1 tfa = mkTyConApp loweredTyCon [typeOf1 (undefined `asArgsType` tfa)] where asArgsType :: f a -> t f a -> f a asArgsType = const++loweredTyCon :: TyCon+#if MIN_VERSION_base(4,4,0)+loweredTyCon = mkTyCon3 "categories" "Control.Categorical.Functor" "LoweredFunctor"+#else+loweredTyCon = mkTyCon "Control.Categorical.Functor.LoweredFunctor"+#endif+{-# NOINLINE loweredTyCon #-}++#endif instance (Typeable1 f, Data (f a), Data a) => Data (LoweredFunctor f a) where gfoldl f z (LoweredFunctor a) = z LoweredFunctor `f` a
src/Control/Category/Dual.hs view
@@ -1,8 +1,11 @@-{-# LANGUAGE TypeOperators, FlexibleContexts #-} {-# LANGUAGE CPP #-}-#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 702+{-# LANGUAGE TypeOperators, FlexibleContexts #-}+#if __GLASGOW_HASKELL__ >= 702 {-# LANGUAGE Trustworthy #-} #endif+#if __GLASGOW_HASKELL__ >= 708+{-# LANGUAGE DeriveDataTypeable #-}+#endif ------------------------------------------------------------------------------------------- -- | -- Module : Control.Category.Dual@@ -22,25 +25,37 @@ #define MIN_VERSION_base(x,y,z) 1 #endif -import Prelude (undefined,const,error) import Control.Category #ifdef __GLASGOW_HASKELL__ import Data.Data (Data(..), mkDataType, DataType, mkConstr, Constr, constrIndex, Fixity(..))+#if __GLASGOW_HASKELL__ < 708 #if MIN_VERSION_base(4,4,0) import Data.Typeable (Typeable2(..), TyCon, mkTyCon3, mkTyConApp, gcast1) #else import Data.Typeable (Typeable2(..), TyCon, mkTyCon, mkTyConApp, gcast1) #endif+import Prelude (undefined,const,error)+#else+import Prelude (error)+import Data.Typeable (Typeable, gcast1) #endif+#endif data Dual k a b = Dual { runDual :: k b a }+#if __GLASGOW_HASKELL__ >= 708+ deriving Typeable +#define Typeable2 Typeable+#endif+ instance Category k => Category (Dual k) where id = Dual id Dual f . Dual g = Dual (g . f) #ifdef __GLASGOW_HASKELL__++#if __GLASGOW_HASKELL__ < 707 instance Typeable2 k => Typeable2 (Dual k) where typeOf2 tfab = mkTyConApp dataTyCon [typeOf2 (undefined `asDualArgsType` tfab)] where asDualArgsType :: f b a -> t f a b -> f b a@@ -53,6 +68,7 @@ dataTyCon = mkTyCon "Control.Category.Dual.Dual" #endif {-# NOINLINE dataTyCon #-}+#endif dualConstr :: Constr dualConstr = mkConstr dataDataType "Dual" [] Prefix