compdata 0.6 → 0.6.1
raw patch · 10 files changed
+33/−18 lines, 10 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Data.Comp.Automata.Product: class :< a b
- Data.Comp.Desugar: instance [overlap ok] (Desugar f g0, Desugar g g0) => Desugar (f :+: g) g0
- Data.Comp.Multi.Desugar: instance [overlap ok] (Desugar f g0, Desugar g g0) => Desugar (f :+: g) g0
- Data.Comp.Multi.HFunctor: type :-> f g = forall i. f i -> g i
- Data.Comp.Multi.HFunctor: type :=> f a = forall i. f i -> a
- Data.Comp.Multi.Ops: class :<: (sub :: (* -> *) -> * -> *) sup
- Data.Comp.Multi.Sum: class :<: (sub :: (* -> *) -> * -> *) sup
- Data.Comp.MultiParam.Desugar: instance [overlap ok] (Desugar f g0, Desugar g g0) => Desugar (f :+: g) g0
- Data.Comp.MultiParam.HDifunctor: type :-> f g = forall i. f i -> g i
- Data.Comp.MultiParam.Ops: class :<: (sub :: (* -> *) -> (* -> *) -> * -> *) sup
- Data.Comp.MultiParam.Sum: class :<: (sub :: (* -> *) -> (* -> *) -> * -> *) sup
- Data.Comp.Ops: class :<: sub sup
- Data.Comp.Param.Desugar: instance [overlap ok] (Desugar f g0, Desugar g g0) => Desugar (f :+: g) g0
- Data.Comp.Param.Ops: class :<: sub sup
- Data.Comp.Param.Sum: class :<: sub sup
- Data.Comp.Sum: class :<: sub sup
+ Data.Comp.Automata.Product: class (:<) a b
+ Data.Comp.Desugar: instance [overlap ok] (Desugar f g0, Desugar g0 g0) => Desugar (f :+: g0) g0
+ Data.Comp.Multi.Desugar: instance [overlap ok] (Desugar f g0, Desugar g0 g0) => Desugar (f :+: g0) g0
+ Data.Comp.Multi.HFunctor: type (:=>) f a = forall i. f i -> a
+ Data.Comp.Multi.Ops: class (:<:) (sub :: (* -> *) -> * -> *) sup
+ Data.Comp.Multi.Sum: class (:<:) (sub :: (* -> *) -> * -> *) sup
+ Data.Comp.MultiParam.Desugar: instance [overlap ok] (Desugar f g0, Desugar g0 g0) => Desugar (f :+: g0) g0
+ Data.Comp.MultiParam.HDifunctor: type (:->) f g = forall i. f i -> g i
+ Data.Comp.MultiParam.Ops: class (:<:) (sub :: (* -> *) -> (* -> *) -> * -> *) sup
+ Data.Comp.MultiParam.Sum: class (:<:) (sub :: (* -> *) -> (* -> *) -> * -> *) sup
+ Data.Comp.Ops: class (:<:) sub sup
+ Data.Comp.Param.Desugar: instance [overlap ok] (Desugar f g0, Desugar g0 g0) => Desugar (f :+: g0) g0
+ Data.Comp.Param.Ops: class (:<:) sub sup
+ Data.Comp.Param.Sum: class (:<:) sub sup
+ Data.Comp.Sum: class (:<:) sub sup
Files
- benchmark/Benchmark.hs +4/−4
- compdata.cabal +10/−6
- src/Data/Comp/Annotation.hs +1/−1
- src/Data/Comp/Automata.hs +8/−1
- src/Data/Comp/Multi/HFoldable.hs +1/−1
- src/Data/Comp/Multi/Ops.hs +3/−1
- src/Data/Comp/Multi/Term.hs +1/−1
- src/Data/Comp/Multi/Variables.hs +1/−1
- src/Data/Comp/MultiParam/Ops.hs +2/−2
- src/Data/Comp/Variables.hs +2/−0
benchmark/Benchmark.hs view
@@ -42,7 +42,7 @@ standardBenchmarks :: (PExpr, SugarExpr, String) -> Benchmark standardBenchmarks (sExpr,aExpr,n) = rnf aExpr `seq` rnf sExpr `seq` getBench (sExpr, aExpr,n)- where getBench (sExpr, aExpr,n) = bgroup n evalBenchmarks+ where getBench (sExpr, aExpr,n) = bgroup n paperBenchmarks -- these are the benchmarks for evaluation evalBenchmarks = [ bench "evalDesug" (nf A.desugEval2 aExpr),@@ -88,13 +88,13 @@ bench "evalDirectM" (nf A.evalDirectE aExpr), bench "eval[Direct]M (comparison)" (nf S.evalSugar sExpr), bench "contVar" (nf (A.contVar' 10) aExpr),- bench "contVar (comparison)" (nf (S.contVar 10) sExpr), bench "contVarG" (nf (A.contVarGen 10) aExpr), bench "contVarU" (nf (S.contVarGen 10) sExpr),- bench "freeVars[GU]" (nf A.freeVars' aExpr),+ bench "contVar (comparison)" (nf (S.contVar 10) sExpr),+ bench "freeVars" (nf A.freeVars' aExpr), bench "freeVarsG" (nf A.freeVarsGen aExpr), bench "freeVarsU" (nf S.freeVarsGen sExpr),- bench "freeVars[GU] (comparison)" (nf S.freeVars sExpr)]+ bench "freeVars (comparison)" (nf S.freeVars sExpr)] -- these are all the benchmarks allBenchmarks = [ bench "Comp.desug" (nf A.desugExpr aExpr),
compdata.cabal view
@@ -1,5 +1,5 @@ Name: compdata-Version: 0.6+Version: 0.6.1 Synopsis: Compositional Data Types Description: @@ -81,6 +81,12 @@ typed parametric higher-order abstract syntax (PHOAS). This extension resides in the module "Data.Comp.MultiParam". .+ * Advanced recursion schemes derived from tree automata. These+ recursion schemes allow for a higher degree of modularity and make+ it possible to apply fusion. See /Modular Tree Automata/+ (Mathematics of Program Construction, 263-299, 2012,+ <http://dx.doi.org/10.1007/978-3-642-31113-0_14>).+ . Examples of using (generalised) (parametric) compositional data types are bundled with the package in the libray @examples@.@@ -287,16 +293,14 @@ hs-source-dirs: src testsuite/tests examples Build-Depends: base == 4.*, template-haskell, containers, mtl, QuickCheck >= 2, HUnit, test-framework, test-framework-hunit, test-framework-quickcheck2, derive, th-expand-syns, deepseq, transformers -Executable benchmark+Benchmark algebra+ Type: exitcode-stdio-1.0 Main-is: Benchmark.hs hs-source-dirs: src benchmark ghc-options: -W -O2 -- Disable short-cut fusion rules in order to compare optimised and unoptimised code. cpp-options: -DNO_RULES- if !flag(benchmark)- buildable: False- else- Build-Depends: base == 4.*, template-haskell, containers, mtl, QuickCheck >= 2, derive, deepseq, criterion, random, uniplate, th-expand-syns, transformers+ Build-Depends: base == 4.*, template-haskell, containers, mtl, QuickCheck >= 2, derive, deepseq, criterion, random, uniplate, th-expand-syns, transformers source-repository head type: hg
src/Data/Comp/Annotation.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE TypeOperators, MultiParamTypeClasses, FlexibleInstances,- UndecidableInstances, Rank2Types, GADTs, ScopedTypeVariables #-}+ UndecidableInstances, Rank2Types, GADTs, ScopedTypeVariables, FlexibleContexts #-} -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Annotation
src/Data/Comp/Automata.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE Rank2Types, FlexibleContexts, ImplicitParams, GADTs, TypeOperators #-}+ -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Automata@@ -16,7 +17,13 @@ -- -- Like regular term homomorphisms also stateful homomorphisms (as -- well as transducers) can be lifted to annotated signatures--- (cf. Data.Comp.Annotation").+-- (cf. "Data.Comp.Annotation").+--+-- The recursion schemes provided in this module are derived from tree+-- automata. They allow for a higher degree of modularity and make it+-- possible to apply fusion. The implementation is based on the paper+-- /Modular Tree Automata/ (Mathematics of Program Construction,+-- 263-299, 2012, <http://dx.doi.org/10.1007/978-3-642-31113-0_14>). -- --------------------------------------------------------------------------------
src/Data/Comp/Multi/HFoldable.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE Rank2Types, TypeOperators, FlexibleInstances, ScopedTypeVariables, GADTs, MultiParamTypeClasses, UndecidableInstances, IncoherentInstances #-}+{-# LANGUAGE RankNTypes, TypeOperators, FlexibleInstances, ScopedTypeVariables, GADTs, MultiParamTypeClasses, UndecidableInstances, IncoherentInstances #-} -------------------------------------------------------------------------------- -- |
src/Data/Comp/Multi/Ops.hs view
@@ -1,6 +1,8 @@ {-# LANGUAGE TypeOperators, MultiParamTypeClasses, IncoherentInstances, FlexibleInstances, FlexibleContexts, GADTs, TypeSynonymInstances,- ScopedTypeVariables, FunctionalDependencies, UndecidableInstances, KindSignatures #-}+ ScopedTypeVariables, FunctionalDependencies, UndecidableInstances, KindSignatures, RankNTypes{-|+ +-} #-} -------------------------------------------------------------------------------- -- |
src/Data/Comp/Multi/Term.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE EmptyDataDecls, GADTs, KindSignatures, Rank2Types,+{-# LANGUAGE EmptyDataDecls, GADTs, KindSignatures, RankNTypes, TypeOperators, ScopedTypeVariables, IncoherentInstances #-} -------------------------------------------------------------------------------- -- |
src/Data/Comp/Multi/Variables.hs view
@@ -1,5 +1,5 @@ {-# LANGUAGE MultiParamTypeClasses, GADTs, FlexibleInstances,- OverlappingInstances, TypeOperators, KindSignatures, FlexibleContexts, ScopedTypeVariables, Rank2Types, TemplateHaskell #-}+ OverlappingInstances, TypeOperators, KindSignatures, FlexibleContexts, ScopedTypeVariables, RankNTypes, TemplateHaskell #-} -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Multi.Variables
src/Data/Comp/MultiParam/Ops.hs view
@@ -1,6 +1,6 @@ {-# LANGUAGE TypeOperators, MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances, UndecidableInstances, IncoherentInstances,- KindSignatures #-}+ KindSignatures, RankNTypes #-} -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.MultiParam.Ops@@ -70,7 +70,7 @@ ffst :: (f :*: g) a b -> f a b ffst (x :*: _) = x -fsnd :: (f :*: g) a b -> g a b+fsnd :: (f :*: g) a b -> g a b fsnd (_ :*: x) = x
src/Data/Comp/Variables.hs view
@@ -1,5 +1,6 @@ {-# LANGUAGE MultiParamTypeClasses, GADTs, FlexibleInstances, OverlappingInstances, TypeOperators, TemplateHaskell #-}+ -------------------------------------------------------------------------------- -- | -- Module : Data.Comp.Variables@@ -14,6 +15,7 @@ -- account. -- --------------------------------------------------------------------------------+ module Data.Comp.Variables ( HasVars(..),