compdata-automata 0.9 → 0.9.1
raw patch · 4 files changed
+14/−9 lines, 4 filesdep ~basedep ~compdatasetup-changed
Dependency ranges changed: base, compdata
Files
- Setup.hs +0/−0
- compdata-automata.cabal +5/−5
- examples/Examples/Automata/Compiler.hs +7/−2
- src/Data/Comp/Automata.hs +2/−2
Setup.hs view
compdata-automata.cabal view
@@ -1,5 +1,5 @@ Name: compdata-automata-Version: 0.9+Version: 0.9.1 Synopsis: Tree automata on Compositional Data Types Description: This library extends the @compdata@ package with advanced recursion@@ -7,8 +7,8 @@ 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>) and /Programming- Macro Tree Transducers/ (Workshop on Generic Programming, 61-72,+ <http://dx.doi.org/10.1007/978-3-642-31113-0_14>) and + /Programming Macro Tree Transducers/ (Workshop on Generic Programming, 61-72, 2013, <http://dx.doi.org/10.1145/2502488.2502489>). @@ -32,7 +32,7 @@ library Exposed-Modules: Data.Comp.Automata Data.Comp.MacroAutomata- Build-Depends: base >= 4.7, base < 5, containers, compdata == 0.9.*, projection+ Build-Depends: base >= 4.7 && < 5, containers, compdata >= 0.9 && < 0.12, projection hs-source-dirs: src ghc-options: -W @@ -44,7 +44,7 @@ ghc-options: -W -O2 -- Disable short-cut fusion rules in order to compare optimised and unoptimised code. cpp-options: -DNO_RULES- Build-Depends: base >= 4.7, base < 5, containers, compdata == 0.9.*, projection, criterion+ Build-Depends: base >= 4.7 && < 5, containers, compdata >= 0.9 && < 0.12, projection, criterion source-repository head type: git
examples/Examples/Automata/Compiler.hs view
@@ -2,6 +2,7 @@ TypeOperators, FlexibleInstances, UndecidableInstances, ScopedTypeVariables, TypeSynonymInstances, GeneralizedNewtypeDeriving, OverlappingInstances, ConstraintKinds #-}+{-# LANGUAGE DeriveFunctor #-} module Examples.Automata.Compiler where @@ -21,18 +22,22 @@ type Var = String data Val a = Const Int+ deriving Functor data Op a = Plus a a | Times a a+ deriving Functor type Core = Op :+: Val+ data Let a = Let Var a a | Var Var-+ deriving Functor type CoreLet = Let :+: Core data Sugar a = Neg a | Minus a a+ deriving Functor -$(derive [makeFunctor, makeFoldable, makeTraversable, smartConstructors, makeShowF]+$(derive [makeFoldable, makeTraversable, smartConstructors, makeShowF] [''Val, ''Op, ''Let, ''Sugar])
src/Data/Comp/Automata.hs view
@@ -185,7 +185,7 @@ -- returns the final state of the run. runUpTransSt :: (Functor f, Functor g) => UpTrans f q g -> Term f -> (q, Term g)-runUpTransSt = cata . upAlg+runUpTransSt up t = cata (upAlg up) t -- | This function generalises 'runUpTrans' to contexts. Therefore, -- additionally, a transition function for the holes is needed.@@ -299,7 +299,7 @@ -- | This combinator runs a GUTA on a term. runDUpState :: Functor f => DUpState f q q -> Term f -> q-runDUpState = runUpState . upState+runDUpState up t = runUpState (upState up) t -- | This combinator constructs the product of two GUTA.