free-category 0.0.4.1 → 0.0.4.2
raw patch · 4 files changed
+32/−25 lines, 4 filesdep ~free-algebrasPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: free-algebras
API changes (from Hackage documentation)
- Control.Category.Free: consC :: forall (f :: k -> k -> *) a b c. f b c -> C f a b -> C f a c
+ Control.Category.Free: consC :: forall k (f :: k -> k -> *) a b c. f b c -> C f a b -> C f a c
- Control.Category.Free: consQ :: forall (f :: k -> k -> *) a b c. f b c -> Queue f a b -> Queue f a c
+ Control.Category.Free: consQ :: forall k (f :: k -> k -> *) a b c. f b c -> Queue f a b -> Queue f a c
- Control.Category.Free: foldNatC :: forall (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> C f a b -> c a b
+ Control.Category.Free: foldNatC :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> C f a b -> c a b
- Control.Category.Free: foldNatL :: forall (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> ListTr f a b -> c a b
+ Control.Category.Free: foldNatL :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> ListTr f a b -> c a b
- Control.Category.Free: foldNatQ :: forall (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> Queue f a b -> c a b
+ Control.Category.Free: foldNatQ :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> Queue f a b -> c a b
- Control.Category.Free: foldlL :: forall (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> ListTr f a b -> c a d
+ Control.Category.Free: foldlL :: forall k (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> ListTr f a b -> c a d
- Control.Category.Free: foldlQ :: forall (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> Queue f a b -> c a d
+ Control.Category.Free: foldlQ :: forall k (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> Queue f a b -> c a d
- Control.Category.Free: foldrL :: forall (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> ListTr f b d -> c a d
+ Control.Category.Free: foldrL :: forall k (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> ListTr f b d -> c a d
- Control.Category.Free: foldrQ :: forall (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> Queue f b d -> c a d
+ Control.Category.Free: foldrQ :: forall k (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> Queue f b d -> c a d
- Control.Category.Free: hoistOp :: forall (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y) -> Op f a b -> Op g a b
+ Control.Category.Free: hoistOp :: forall k (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y) -> Op f a b -> Op g a b
- Control.Category.Free: liftC :: forall (f :: k -> k -> *) a b. f a b -> C f a b
+ Control.Category.Free: liftC :: forall k (f :: k -> k -> *) a b. f a b -> C f a b
- Control.Category.Free: liftL :: forall (f :: k -> k -> *) x y. f x y -> ListTr f x y
+ Control.Category.Free: liftL :: forall k (f :: k -> k -> *) x y. f x y -> ListTr f x y
- Control.Category.Free: liftQ :: forall (f :: k -> k -> *) a b. f a b -> Queue f a b
+ Control.Category.Free: liftQ :: forall k (f :: k -> k -> *) a b. f a b -> Queue f a b
- Control.Category.Free: snocQ :: forall (f :: k -> k -> *) a b c. Queue f b c -> f a b -> Queue f a c
+ Control.Category.Free: snocQ :: forall k (f :: k -> k -> *) a b c. Queue f b c -> f a b -> Queue f a c
- Control.Category.Free.Internal: consQ :: forall (f :: k -> k -> *) a b c. f b c -> Queue f a b -> Queue f a c
+ Control.Category.Free.Internal: consQ :: forall k (f :: k -> k -> *) a b c. f b c -> Queue f a b -> Queue f a c
- Control.Category.Free.Internal: foldNatL :: forall (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> ListTr f a b -> c a b
+ Control.Category.Free.Internal: foldNatL :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> ListTr f a b -> c a b
- Control.Category.Free.Internal: foldNatQ :: forall (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> Queue f a b -> c a b
+ Control.Category.Free.Internal: foldNatQ :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> Queue f a b -> c a b
- Control.Category.Free.Internal: foldlL :: forall (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> ListTr f a b -> c a d
+ Control.Category.Free.Internal: foldlL :: forall k (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> ListTr f a b -> c a d
- Control.Category.Free.Internal: foldlQ :: forall (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> Queue f a b -> c a d
+ Control.Category.Free.Internal: foldlQ :: forall k (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> Queue f a b -> c a d
- Control.Category.Free.Internal: foldrL :: forall (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> ListTr f b d -> c a d
+ Control.Category.Free.Internal: foldrL :: forall k (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> ListTr f b d -> c a d
- Control.Category.Free.Internal: foldrQ :: forall (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> Queue f b d -> c a d
+ Control.Category.Free.Internal: foldrQ :: forall k (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> Queue f b d -> c a d
- Control.Category.Free.Internal: hoistOp :: forall (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y) -> Op f a b -> Op g a b
+ Control.Category.Free.Internal: hoistOp :: forall k (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y) -> Op f a b -> Op g a b
- Control.Category.Free.Internal: hoistQ :: forall (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y) -> Queue f a b -> Queue g a b
+ Control.Category.Free.Internal: hoistQ :: forall k (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y) -> Queue f a b -> Queue g a b
- Control.Category.Free.Internal: liftL :: forall (f :: k -> k -> *) x y. f x y -> ListTr f x y
+ Control.Category.Free.Internal: liftL :: forall k (f :: k -> k -> *) x y. f x y -> ListTr f x y
- Control.Category.Free.Internal: liftQ :: forall (f :: k -> k -> *) a b. f a b -> Queue f a b
+ Control.Category.Free.Internal: liftQ :: forall k (f :: k -> k -> *) a b. f a b -> Queue f a b
- Control.Category.Free.Internal: snocQ :: forall (f :: k -> k -> *) a b c. Queue f b c -> f a b -> Queue f a c
+ Control.Category.Free.Internal: snocQ :: forall k (f :: k -> k -> *) a b c. Queue f b c -> f a b -> Queue f a c
Files
- ChangeLog.md +3/−0
- free-category.cabal +10/−8
- src/Control/Category/Free.hs +3/−3
- src/Control/Category/Free/Internal.hs +16/−14
ChangeLog.md view
@@ -1,5 +1,8 @@ # Changelog for free-category +## Version 0.0.4.2+- updated for *GHC 8.10.1*+ ## Version 0.0.4.0 - hoistOp - Renamed `Control.Category.FreeEff` module as `Control.Category.FreeEffect`
free-category.cabal view
@@ -1,11 +1,12 @@+cabal-version: 2.0 name: free-category-version: 0.0.4.1+version: 0.0.4.2 synopsis: efficient data types for free categories and arrows description:- Provide various data types for free categories / type aligned queues, type- classes which allow to write abstract categories with side effects (Kleisli- like categories). These are useful for encoding type safe state machines.- Free arrows are also provided.+ This package provides various data types for free categories, type+ aligned queues, arrows and type classes which allow to write abstract+ categories with side effects (Kleisli like categories). These are useful+ for encoding type safe state machines. Free arrows are also provided. category: Algebra, Control, Monads, Category homepage: https://github.com/coot/free-category#readme bug-reports: https://github.com/coot/free-category/issues@@ -15,7 +16,6 @@ license: MPL-2.0 license-file: LICENSE build-type: Simple-cabal-version: >= 1.10 extra-source-files: ChangeLog.md README.md@@ -23,7 +23,7 @@ bench/report-O1.md bench/report-O2.md stability: experimental-tested-with: GHC==8.0.2, GHC==8.2.2, GHC==8.4.4, GHC==8.6.5, GHC==8.8.1+tested-with: GHC==8.6.5, GHC==8.8.3, GHC==8.10.1 source-repository head type: git@@ -37,11 +37,13 @@ Control.Category.FreeEffect other-modules: Paths_free_category+ autogen-modules:+ Paths_free_category hs-source-dirs: src build-depends: base >= 4.9 && <5- , free-algebras >= 0.0.8.0+ , free-algebras >= 0.0.8.2 ghc-options: -Wall -fwarn-incomplete-record-updates
src/Control/Category/Free.hs view
@@ -127,20 +127,20 @@ fromC = hoistFreeH2 {-# INLINE fromC #-} -liftC :: forall (f :: k -> k -> *) a b.+liftC :: forall k (f :: k -> k -> *) a b. f a b -> C f a b liftC = \f -> C $ \k -> k f {-# INLINE [1] liftC #-} -consC :: forall (f :: k -> k -> *) a b c.+consC :: forall k (f :: k -> k -> *) a b c. f b c -> C f a b -> C f a c consC bc ab = liftC bc `composeC` ab {-# INLINE [1] consC #-} -foldNatC :: forall (f :: k -> k -> *) c a b.+foldNatC :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> C f a b
src/Control/Category/Free/Internal.hs view
@@ -75,7 +75,8 @@ -- | 'Op' is an endo-functor of the category of categories. ---hoistOp :: forall (f :: k -> k -> *)+hoistOp :: forall k+ (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y)@@ -129,7 +130,7 @@ lengthListTr NilTr = 0 lengthListTr (ConsTr _ xs) = 1 + lengthListTr xs -composeL :: forall (f :: k -> k -> *) x y z.+composeL :: forall k (f :: k -> k -> *) x y z. ListTr f y z -> ListTr f x y -> ListTr f x z@@ -137,12 +138,12 @@ composeL NilTr ys = ys {-# INLINE [1] composeL #-} -liftL :: forall (f :: k -> k -> *) x y.+liftL :: forall k (f :: k -> k -> *) x y. f x y -> ListTr f x y liftL f = ConsTr f NilTr {-# INLINE [1] liftL #-} -foldNatL :: forall (f :: k -> k -> *) c a b.+foldNatL :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> ListTr f a b@@ -172,7 +173,7 @@ -- | 'foldr' of a 'ListTr' ---foldrL :: forall (f :: k -> k -> *) c a b d.+foldrL :: forall k (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> ListTr f b d@@ -185,7 +186,7 @@ -- -- TODO: make it strict, like 'foldl''. ---foldlL :: forall (f :: k -> k -> *) c a b d.+foldlL :: forall k (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> ListTr f a b@@ -294,7 +295,7 @@ {-# complete NilQ, ConsQ #-} #endif -composeQ :: forall (f :: k -> k -> *) x y z.+composeQ :: forall k (f :: k -> k -> *) x y z. Queue f y z -> Queue f x y -> Queue f x z@@ -306,7 +307,7 @@ nilQ = Queue NilTr NilTr NilTr {-# INLINE [1] nilQ #-} -consQ :: forall (f :: k -> k -> *) a b c.+consQ :: forall k (f :: k -> k -> *) a b c. f b c -> Queue f a b -> Queue f a c@@ -326,7 +327,7 @@ unconsQ _ = error "Queue.uncons: invariant violation" {-# INLINE unconsQ #-} -snocQ :: forall (f :: k -> k -> *) a b c.+snocQ :: forall k (f :: k -> k -> *) a b c. Queue f b c -> f a b -> Queue f a c@@ -335,7 +336,7 @@ -- | 'foldr' of a 'Queue' ---foldrQ :: forall (f :: k -> k -> *) c a b d.+foldrQ :: forall k (f :: k -> k -> *) c a b d. (forall x y z. f y z -> c x y -> c x z) -> c a b -> Queue f b d@@ -367,7 +368,7 @@ #-} -liftQ :: forall (f :: k -> k -> *) a b.+liftQ :: forall k (f :: k -> k -> *) a b. f a b -> Queue f a b liftQ = \fab -> ConsQ fab NilQ {-# INLINE [1] liftQ #-}@@ -376,7 +377,7 @@ -- -- /complexity/ @O\(n\)@ ---foldNatQ :: forall (f :: k -> k -> *) c a b.+foldNatQ :: forall k (f :: k -> k -> *) c a b. Category c => (forall x y. f x y -> c x y) -> Queue f a b@@ -407,7 +408,7 @@ -- -- TODO: make it strict, like 'foldl''. ---foldlQ :: forall (f :: k -> k -> *) c a b d.+foldlQ :: forall k (f :: k -> k -> *) c a b d. (forall x y z. c y z -> f x y -> c x z) -> c b d -> Queue f a b@@ -433,7 +434,8 @@ -- categories), thus one can hoist the transitions using a natural -- transformation. This in analogy to @'map' :: (a -> b) -> [a] -> [b]@. ---hoistQ :: forall (f :: k -> k -> *)+hoistQ :: forall k+ (f :: k -> k -> *) (g :: k -> k -> *) a b. (forall x y. f x y -> g x y)