Skip to content

Commit

Permalink
Port to haskell-src-exts-1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
ndmitchell committed Nov 18, 2015
1 parent fefce06 commit 1925379
Show file tree
Hide file tree
Showing 34 changed files with 400 additions and 402 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Changelog for Derive

Require haskell-src-exts-1.17
2.5.22
#7, #8 convert more types from TemplateHaskell
2.5.21
Expand Down
13 changes: 6 additions & 7 deletions Data/Derive/Arbitrary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,12 @@ makeArbitrary = derivationCustomDSL "Arbitrary" custom $
App "UnQual" (List [App "Ident" (List [CtorName])])])],MapField (
App "Var" (List [App "UnQual" (List [App "Ident" (List [Concat (
List [String "x",ShowInt FieldIndex])])])]))]))])])])]])])]),App
"BDecls" (List [List []])])),List [App "Alt" (List [App
"PWildCard" (List []),App "UnGuardedRhs" (List [App "App" (List [
App "Var" (List [App "UnQual" (List [App "Ident" (List [String
"error"])])]),App "Lit" (List [App "String" (List [String
"FATAL ERROR: Arbitrary instance, logic bug"])])])]),App "BDecls"
(List [List []])])]])])])]])]),App "BDecls" (List [List []])])])])
]
"Nothing" (List [])])),List [App "Alt" (List [App "PWildCard" (
List []),App "UnGuardedRhs" (List [App "App" (List [App "Var" (
List [App "UnQual" (List [App "Ident" (List [String "error"])])]),
App "Lit" (List [App "String" (List [String
"FATAL ERROR: Arbitrary instance, logic bug"])])])]),App "Nothing"
(List [])])]])])])]])]),App "Nothing" (List [])])])])]
-- GENERATED STOP

custom = customContext context
Expand Down
32 changes: 16 additions & 16 deletions Data/Derive/ArbitraryOld.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,20 @@ dslArbitraryOld =
List [App "UnQual" (List [App "Ident" (List [CtorName])])])],
MapField (App "Var" (List [App "UnQual" (List [App "Ident" (List [
Concat (List [String "x",ShowInt FieldIndex])])])]))]))])])])]])])
]),App "BDecls" (List [List []])]))])])]])]),App "BDecls" (List [
List []])])]),App "InsDecl" (List [App "FunBind" (List [MapCtor (
App "Match" (List [App "Ident" (List [String "coarbitrary"]),List
[App "PParen" (List [App "PApp" (List [App "UnQual" (List [App
"Ident" (List [CtorName])]),MapField (App "PVar" (List [App
"Ident" (List [Concat (List [String "x",ShowInt FieldIndex])])]))]
)])],App "Nothing" (List []),App "UnGuardedRhs" (List [Fold (App
"InfixApp" (List [Head,App "QVarOp" (List [App "UnQual" (List [App
"Symbol" (List [String "."])])]),Tail])) (Concat (List [List [App
"App" (List [App "Var" (List [App "UnQual" (List [App "Ident" (
List [String "variant"])])]),App "Lit" (List [App "Int" (List [
CtorIndex])])])],MapField (App "App" (List [App "Var" (List [App
"UnQual" (List [App "Ident" (List [String "coarbitrary"])])]),App
"Var" (List [App "UnQual" (List [App "Ident" (List [Concat (List [
String "x",ShowInt FieldIndex])])])])]))]))]),App "BDecls" (List [
List []])]))])])])]
]),App "Nothing" (List [])]))])])]])]),App "Nothing" (List [])])])
,App "InsDecl" (List [App "FunBind" (List [MapCtor (App "Match" (
List [App "Ident" (List [String "coarbitrary"]),List [App "PParen"
(List [App "PApp" (List [App "UnQual" (List [App "Ident" (List [
CtorName])]),MapField (App "PVar" (List [App "Ident" (List [Concat
(List [String "x",ShowInt FieldIndex])])]))])])],App "Nothing" (
List []),App "UnGuardedRhs" (List [Fold (App "InfixApp" (List [
Head,App "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [
String "."])])]),Tail])) (Concat (List [List [App "App" (List [App
"Var" (List [App "UnQual" (List [App "Ident" (List [String
"variant"])])]),App "Lit" (List [App "Int" (List [CtorIndex])])])]
,MapField (App "App" (List [App "Var" (List [App "UnQual" (List [
App "Ident" (List [String "coarbitrary"])])]),App "Var" (List [App
"UnQual" (List [App "Ident" (List [Concat (List [String "x",
ShowInt FieldIndex])])])])]))]))]),App "Nothing" (List [])]))])])]
)]
-- GENERATED STOP
4 changes: 2 additions & 2 deletions Data/Derive/Arities.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ dslArities =
Application (List [App "Var" (List [App "UnQual" (List [App
"Ident" (List [String "const"])])]),App "Lit" (List [App "Int" (
List [CtorArity])]),App "RecConstr" (List [App "UnQual" (List [App
"Ident" (List [CtorName])]),List []])]))])]),App "BDecls" (List [
List []])])]])])])]
"Ident" (List [CtorName])]),List []])]))])]),App "Nothing" (List [
])])]])])])]
-- GENERATED STOP
104 changes: 52 additions & 52 deletions Data/Derive/Binary.hs
Original file line number Diff line number Diff line change
Expand Up @@ -72,63 +72,63 @@ dslBinary =
List [App "UnQual" (List [App "Ident" (List [String "put"])])]),
App "Var" (List [App "UnQual" (List [App "Ident" (List [Concat (
List [String "x",ShowInt FieldIndex])])])])])]))])])]),App
"BDecls" (List [List []])]))])]),App "BDecls" (List [List [App
"PatBind" (List [App "PVar" (List [App "Ident" (List [String
"useTag"])]),App "UnGuardedRhs" (List [App "InfixApp" (List [App
"App" (List [App "Var" (List [App "UnQual" (List [App "Ident" (
List [String "length"])])]),App "List" (List [MapCtor (App
"Nothing" (List [])]))])]),App "Just" (List [App "BDecls" (List [
List [App "PatBind" (List [App "PVar" (List [App "Ident" (List [
String "useTag"])]),App "UnGuardedRhs" (List [App "InfixApp" (List
[App "App" (List [App "Var" (List [App "UnQual" (List [App "Ident"
(List [String "length"])])]),App "List" (List [MapCtor (App
"RecConstr" (List [App "UnQual" (List [App "Ident" (List [CtorName
])]),List []]))])]),App "QVarOp" (List [App "UnQual" (List [App
"Symbol" (List [String ">"])])]),App "Lit" (List [App "Int" (List
[Int 1])])])]),App "BDecls" (List [List []])]),App "FunBind" (List
[List [App "Match" (List [App "Ident" (List [String "putTag"]),
List [App "PVar" (List [App "Ident" (List [String "x"])])],App
"Nothing" (List []),App "UnGuardedRhs" (List [Application (List [
[Int 1])])])]),App "Nothing" (List [])]),App "FunBind" (List [List
[App "Match" (List [App "Ident" (List [String "putTag"]),List [App
"PVar" (List [App "Ident" (List [String "x"])])],App "Nothing" (
List []),App "UnGuardedRhs" (List [Application (List [App "Var" (
List [App "UnQual" (List [App "Ident" (List [String "when"])])]),
App "Var" (List [App "UnQual" (List [App "Ident" (List [String
"when"])])]),App "Var" (List [App "UnQual" (List [App "Ident" (
List [String "useTag"])])]),App "Paren" (List [App "App" (List [
App "Var" (List [App "UnQual" (List [App "Ident" (List [Concat (
List [String "putWord",ShowInt (Int 8)])])])]),App "Var" (List [
App "UnQual" (List [App "Ident" (List [String "x"])])])])])])]),
App "BDecls" (List [List []])])]])]])])]])]),App "InsDecl" (List [
App "PatBind" (List [App "PVar" (List [App "Ident" (List [String
"get"])]),App "UnGuardedRhs" (List [App "Do" (List [List [App
"Generator" (List [App "PVar" (List [App "Ident" (List [String "i"
])]),App "Var" (List [App "UnQual" (List [App "Ident" (List [
String "getTag"])])])]),App "Qualifier" (List [App "Case" (List [
App "Var" (List [App "UnQual" (List [App "Ident" (List [String "i"
])])]),Concat (List [MapCtor (App "Alt" (List [App "PLit" (List [
App "Signless" (List []),App "Int" (List [CtorIndex])]),App
"UnGuardedRhs" (List [App "Do" (List [Concat (List [MapField (App
"Generator" (List [App "PVar" (List [App "Ident" (List [Concat (
List [String "x",ShowInt FieldIndex])])]),App "Var" (List [App
"UnQual" (List [App "Ident" (List [String "get"])])])])),List [App
"Qualifier" (List [App "App" (List [App "Var" (List [App "UnQual"
(List [App "Ident" (List [String "return"])])]),App "Paren" (List
[Application (Concat (List [List [App "Con" (List [App "UnQual" (
List [App "Ident" (List [CtorName])])])],MapField (App "Var" (List
[App "UnQual" (List [App "Ident" (List [Concat (List [String "x",
ShowInt FieldIndex])])])]))]))])])])]])])]),App "BDecls" (List [
List []])])),List [App "Alt" (List [App "PWildCard" (List []),App
"useTag"])])]),App "Paren" (List [App "App" (List [App "Var" (List
[App "UnQual" (List [App "Ident" (List [Concat (List [String
"putWord",ShowInt (Int 8)])])])]),App "Var" (List [App "UnQual" (
List [App "Ident" (List [String "x"])])])])])])]),App "Nothing" (
List [])])]])]])])])]])]),App "InsDecl" (List [App "PatBind" (List
[App "PVar" (List [App "Ident" (List [String "get"])]),App
"UnGuardedRhs" (List [App "Do" (List [List [App "Generator" (List
[App "PVar" (List [App "Ident" (List [String "i"])]),App "Var" (
List [App "UnQual" (List [App "Ident" (List [String "getTag"])])])
]),App "Qualifier" (List [App "Case" (List [App "Var" (List [App
"UnQual" (List [App "Ident" (List [String "i"])])]),Concat (List [
MapCtor (App "Alt" (List [App "PLit" (List [App "Signless" (List [
]),App "Int" (List [CtorIndex])]),App "UnGuardedRhs" (List [App
"Do" (List [Concat (List [MapField (App "Generator" (List [App
"PVar" (List [App "Ident" (List [Concat (List [String "x",ShowInt
FieldIndex])])]),App "Var" (List [App "UnQual" (List [App "Ident"
(List [String "get"])])])])),List [App "Qualifier" (List [App
"App" (List [App "Var" (List [App "UnQual" (List [App "Ident" (
List [String "return"])])]),App "Paren" (List [Application (Concat
(List [List [App "Con" (List [App "UnQual" (List [App "Ident" (
List [CtorName])])])],MapField (App "Var" (List [App "UnQual" (
List [App "Ident" (List [Concat (List [String "x",ShowInt
FieldIndex])])])]))]))])])])]])])]),App "Nothing" (List [])])),
List [App "Alt" (List [App "PWildCard" (List []),App
"UnGuardedRhs" (List [App "App" (List [App "Var" (List [App
"UnQual" (List [App "Ident" (List [String "error"])])]),App "Lit"
(List [App "String" (List [Concat (List [String
"Corrupted binary data for ",DataName])])])])]),App "BDecls" (List
[List []])])]])])])]])]),App "BDecls" (List [List [App "PatBind" (
List [App "PVar" (List [App "Ident" (List [String "useTag"])]),App
"UnGuardedRhs" (List [App "InfixApp" (List [App "App" (List [App
"Var" (List [App "UnQual" (List [App "Ident" (List [String
"length"])])]),App "List" (List [MapCtor (App "RecConstr" (List [
App "UnQual" (List [App "Ident" (List [CtorName])]),List []]))])])
,App "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [
String ">"])])]),App "Lit" (List [App "Int" (List [Int 1])])])]),
App "BDecls" (List [List []])]),App "PatBind" (List [App "PVar" (
List [App "Ident" (List [String "getTag"])]),App "UnGuardedRhs" (
List [App "If" (List [App "Var" (List [App "UnQual" (List [App
"Ident" (List [String "useTag"])])]),App "Var" (List [App "UnQual"
(List [App "Ident" (List [Concat (List [String "getWord",ShowInt (
Int 8)])])])]),App "App" (List [App "Var" (List [App "UnQual" (
List [App "Ident" (List [String "return"])])]),App "Lit" (List [
App "Int" (List [Int 0])])])])]),App "BDecls" (List [List []])])]]
)])])])]
"Corrupted binary data for ",DataName])])])])]),App "Nothing" (
List [])])]])])])]])]),App "Just" (List [App "BDecls" (List [List
[App "PatBind" (List [App "PVar" (List [App "Ident" (List [String
"useTag"])]),App "UnGuardedRhs" (List [App "InfixApp" (List [App
"App" (List [App "Var" (List [App "UnQual" (List [App "Ident" (
List [String "length"])])]),App "List" (List [MapCtor (App
"RecConstr" (List [App "UnQual" (List [App "Ident" (List [CtorName
])]),List []]))])]),App "QVarOp" (List [App "UnQual" (List [App
"Symbol" (List [String ">"])])]),App "Lit" (List [App "Int" (List
[Int 1])])])]),App "Nothing" (List [])]),App "PatBind" (List [App
"PVar" (List [App "Ident" (List [String "getTag"])]),App
"UnGuardedRhs" (List [App "If" (List [App "Var" (List [App
"UnQual" (List [App "Ident" (List [String "useTag"])])]),App "Var"
(List [App "UnQual" (List [App "Ident" (List [Concat (List [String
"getWord",ShowInt (Int 8)])])])]),App "App" (List [App "Var" (List
[App "UnQual" (List [App "Ident" (List [String "return"])])]),App
"Lit" (List [App "Int" (List [Int 0])])])])]),App "Nothing" (List
[])])]])])])])])]
-- GENERATED STOP
2 changes: 1 addition & 1 deletion Data/Derive/BinaryDefer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,5 @@ dslBinaryDefer =
)),List [App "App" (List [App "Var" (List [App "UnQual" (List [App
"Ident" (List [String "unit"])])]),App "Con" (List [App "UnQual" (
List [App "Ident" (List [CtorName])])])])]]))])]))])])]),App
"BDecls" (List [List []])])])])]
"Nothing" (List [])])])])]
-- GENERATED STOP
21 changes: 10 additions & 11 deletions Data/Derive/Bounded.hs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,15 @@ dslBounded =
List [App "UnQual" (List [App "Ident" (List [String "const"])])]),
App "Var" (List [App "UnQual" (List [App "Ident" (List [String
"minBound"])])]),App "Lit" (List [App "Int" (List [FieldIndex])])]
)]))])))])])]),App "BDecls" (List [List []])])]),App "InsDecl" (
List [App "PatBind" (List [App "PVar" (List [App "Ident" (List [
String "maxBound"])]),App "UnGuardedRhs" (List [App "App" (List [
)]))])))])])]),App "Nothing" (List [])])]),App "InsDecl" (List [
App "PatBind" (List [App "PVar" (List [App "Ident" (List [String
"maxBound"])]),App "UnGuardedRhs" (List [App "App" (List [App
"Var" (List [App "UnQual" (List [App "Ident" (List [String "head"]
)])]),App "List" (List [Reverse (MapCtor (Application (Concat (
List [List [App "Con" (List [App "UnQual" (List [App "Ident" (List
[CtorName])])])],MapField (App "Paren" (List [Application (List [
App "Var" (List [App "UnQual" (List [App "Ident" (List [String
"head"])])]),App "List" (List [Reverse (MapCtor (Application (
Concat (List [List [App "Con" (List [App "UnQual" (List [App
"Ident" (List [CtorName])])])],MapField (App "Paren" (List [
Application (List [App "Var" (List [App "UnQual" (List [App
"Ident" (List [String "const"])])]),App "Var" (List [App "UnQual"
(List [App "Ident" (List [String "maxBound"])])]),App "Lit" (List
[App "Int" (List [FieldIndex])])])]))]))))])])]),App "BDecls" (
List [List []])])])])]
"const"])])]),App "Var" (List [App "UnQual" (List [App "Ident" (
List [String "maxBound"])])]),App "Lit" (List [App "Int" (List [
FieldIndex])])])]))]))))])])]),App "Nothing" (List [])])])])]
-- GENERATED STOP
Loading

0 comments on commit 1925379

Please sign in to comment.