regular 0.3.0 → 0.3.1
raw patch · 4 files changed
+20/−7 lines, 4 files
Files
- ChangeLog +7/−0
- examples/Test.hs +6/−0
- regular.cabal +3/−3
- src/Generics/Regular/TH.hs +4/−4
ChangeLog view
@@ -1,3 +1,10 @@+version 0.3.1:+ - Fix a bug in the Template Haskell code (thanks to lists@snowlion.nl)++version 0.3.0:+ - Remove gdseq (moved to the regular-extras package due to the introduction+ of the deepseq dependency).+ version 0.2.4: - Export Assoc(..) from Generics.Regular.Functions.Crush (thanks to Martijn van Steenbergen).
examples/Test.hs view
@@ -11,7 +11,12 @@ import qualified Generics.Regular.Functions.Read as G import Generics.Regular.Functions.Eq +data X = X {one :: Int, three :: Float} +$(deriveAll ''X "Y")+type instance PF X = Y++{- -- Datatype representing logical expressions data Logic = Var String | Logic :->: Logic -- implication@@ -70,3 +75,4 @@ -- Testing conNames ex9 = conNames (undefined :: Logic)+-}
regular.cabal view
@@ -1,5 +1,5 @@ name: regular-version: 0.3.0+version: 0.3.1 synopsis: Generic programming library for regular datatypes. description: @@ -21,7 +21,7 @@ \[1] <http://hackage.haskell.org/package/multirec> category: Generics-copyright: (c) 2010 Universiteit Utrecht+copyright: (c) 2011 Universiteit Utrecht license: BSD3 license-file: LICENSE author: Jose Pedro Magalhaes@@ -29,7 +29,7 @@ stability: experimental build-type: Custom cabal-version: >= 1.2.1-tested-with: GHC == 6.10.4, GHC == 6.12.1, GHC == 7.0.0.20100925+tested-with: GHC == 6.10.4, GHC == 6.12.1, GHC == 7.0.1 extra-source-files: examples/Test.hs ChangeLog CREDITS
src/Generics/Regular/TH.hs view
@@ -242,8 +242,8 @@ pfField d t = conT ''K `appT` return t pfField' :: (Name, [Name]) -> Name -> (Name, Strict, Type) -> Q Type-pfField' d ns (_, _, t) | t == dataDeclToType d = conT ''I-pfField' (dt, vs) ns (f, _, t) = conT ''S `appT` conT (genName [dt, ns, f]) `appT` (conT ''K `appT` return t)+pfField' d@(dt, vs) ns (f, _, t) | t == dataDeclToType d = conT ''S `appT` conT (genName [dt, ns, f]) `appT` conT ''I+pfField' (dt, vs) ns (f, _, t) = conT ''S `appT` conT (genName [dt, ns, f]) `appT` (conT ''K `appT` return t) mkFrom :: Name -> Int -> Int -> Name -> Q [Q Clause] mkFrom ns m i n =@@ -307,7 +307,7 @@ fromField (dt, vs) nr t = conE 'K `appE` varE (field nr) fromField' :: (Name, [Name]) -> Int -> (Name, Strict, Type) -> Q Exp-fromField' (dt, vs) nr (_, _, t) | t == dataDeclToType (dt, vs) = conE 'I `appE` varE (field nr)+fromField' (dt, vs) nr (_, _, t) | t == dataDeclToType (dt, vs) = conE 'S `appE` (conE 'I `appE` varE (field nr)) fromField' (dt, vs) nr (_, _, t) = conE 'S `appE` (conE 'K `appE` varE (field nr)) toCon :: (Q Pat -> Q Pat) -> Name -> (Name, [Name]) -> Int -> Int -> Con -> Q Clause@@ -340,7 +340,7 @@ toField (dt, vs) nr t = conP 'K [varP (field nr)] toField' :: (Name, [Name]) -> Int -> (Name, Strict, Type) -> Q Pat-toField' (dt, vs) nr (_, _, t) | t == dataDeclToType (dt, vs) = conP 'I [varP (field nr)]+toField' (dt, vs) nr (_, _, t) | t == dataDeclToType (dt, vs) = conP 'S [conP 'I [varP (field nr)]] toField' (dt, vs) nr (_, _, t) = conP 'S [conP 'K [varP (field nr)]] field :: Int -> Name