diff --git a/CHANGES.txt b/CHANGES.txt
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -1,5 +1,7 @@
 Changelog for Derive
 
+2.5.23
+    Require haskell-src-exts-1.17
 2.5.22
     #7, #8 convert more types from TemplateHaskell
 2.5.21
diff --git a/Data/Derive/Arbitrary.hs b/Data/Derive/Arbitrary.hs
--- a/Data/Derive/Arbitrary.hs
+++ b/Data/Derive/Arbitrary.hs
@@ -61,13 +61,12 @@
     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
diff --git a/Data/Derive/ArbitraryOld.hs b/Data/Derive/ArbitraryOld.hs
--- a/Data/Derive/ArbitraryOld.hs
+++ b/Data/Derive/ArbitraryOld.hs
@@ -55,20 +55,20 @@
     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
diff --git a/Data/Derive/Arities.hs b/Data/Derive/Arities.hs
--- a/Data/Derive/Arities.hs
+++ b/Data/Derive/Arities.hs
@@ -39,6 +39,6 @@
     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
diff --git a/Data/Derive/Binary.hs b/Data/Derive/Binary.hs
--- a/Data/Derive/Binary.hs
+++ b/Data/Derive/Binary.hs
@@ -72,63 +72,63 @@
     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
diff --git a/Data/Derive/BinaryDefer.hs b/Data/Derive/BinaryDefer.hs
--- a/Data/Derive/BinaryDefer.hs
+++ b/Data/Derive/BinaryDefer.hs
@@ -59,5 +59,5 @@
     )),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
diff --git a/Data/Derive/Bounded.hs b/Data/Derive/Bounded.hs
--- a/Data/Derive/Bounded.hs
+++ b/Data/Derive/Bounded.hs
@@ -28,16 +28,15 @@
     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
diff --git a/Data/Derive/Data.hs b/Data/Derive/Data.hs
--- a/Data/Derive/Data.hs
+++ b/Data/Derive/Data.hs
@@ -67,49 +67,48 @@
     Concat (List [String "x",ShowInt FieldIndex])])])]))),List [App
     "App" (List [App "Var" (List [App "UnQual" (List [App "Ident" (
     List [String "r"])])]),App "Con" (List [App "UnQual" (List [App
-    "Ident" (List [CtorName])])])])]]))]),App "BDecls" (List [List []]
-    )]))])]),App "InsDecl" (List [App "FunBind" (List [List [App
-    "Match" (List [App "Ident" (List [String "gunfold"]),List [App
-    "PVar" (List [App "Ident" (List [String "k"])]),App "PVar" (List [
-    App "Ident" (List [String "z"])]),App "PVar" (List [App "Ident" (
-    List [String "c"])])],App "Nothing" (List []),App "UnGuardedRhs" (
-    List [App "Case" (List [App "InfixApp" (List [App "App" (List [App
-    "Var" (List [App "UnQual" (List [App "Ident" (List [String
-    "constrIndex"])])]),App "Var" (List [App "UnQual" (List [App
-    "Ident" (List [String "c"])])])]),App "QVarOp" (List [App "UnQual"
-    (List [App "Symbol" (List [String "-"])])]),App "Lit" (List [App
-    "Int" (List [Int 1])])]),Concat (List [MapCtor (App "Alt" (List [
-    App "PLit" (List [App "Signless" (List []),App "Int" (List [
-    CtorIndex])]),App "UnGuardedRhs" (List [Fold (App "InfixApp" (List
-    [Head,App "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [
-    String "$"])])]),Tail])) (Concat (List [MapField (Application (
+    "Ident" (List [CtorName])])])])]]))]),App "Nothing" (List [])]))])
+    ]),App "InsDecl" (List [App "FunBind" (List [List [App "Match" (
+    List [App "Ident" (List [String "gunfold"]),List [App "PVar" (List
+    [App "Ident" (List [String "k"])]),App "PVar" (List [App "Ident" (
+    List [String "z"])]),App "PVar" (List [App "Ident" (List [String
+    "c"])])],App "Nothing" (List []),App "UnGuardedRhs" (List [App
+    "Case" (List [App "InfixApp" (List [App "App" (List [App "Var" (
+    List [App "UnQual" (List [App "Ident" (List [String "constrIndex"]
+    )])]),App "Var" (List [App "UnQual" (List [App "Ident" (List [
+    String "c"])])])]),App "QVarOp" (List [App "UnQual" (List [App
+    "Symbol" (List [String "-"])])]),App "Lit" (List [App "Int" (List
+    [Int 1])])]),Concat (List [MapCtor (App "Alt" (List [App "PLit" (
+    List [App "Signless" (List []),App "Int" (List [CtorIndex])]),App
+    "UnGuardedRhs" (List [Fold (App "InfixApp" (List [Head,App
+    "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [String "$"
+    ])])]),Tail])) (Concat (List [MapField (Application (List [App
+    "Var" (List [App "UnQual" (List [App "Ident" (List [String "const"
+    ])])]),App "Var" (List [App "UnQual" (List [App "Ident" (List [
+    String "k"])])]),App "Lit" (List [App "Int" (List [FieldIndex])])]
+    )),List [App "App" (List [App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [String "z"])])]),App "Con" (List [App "UnQual" (
+    List [App "Ident" (List [CtorName])])])])]]))]),App "Nothing" (
+    List [])])),List [App "Alt" (List [App "PVar" (List [App "Ident" (
+    List [String "i"])]),App "UnGuardedRhs" (List [App "InfixApp" (
     List [App "Var" (List [App "UnQual" (List [App "Ident" (List [
-    String "const"])])]),App "Var" (List [App "UnQual" (List [App
-    "Ident" (List [String "k"])])]),App "Lit" (List [App "Int" (List [
-    FieldIndex])])])),List [App "App" (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "z"])])]),App "Con" (
-    List [App "UnQual" (List [App "Ident" (List [CtorName])])])])]]))]
-    ),App "BDecls" (List [List []])])),List [App "Alt" (List [App
-    "PVar" (List [App "Ident" (List [String "i"])]),App "UnGuardedRhs"
-    (List [App "InfixApp" (List [App "Var" (List [App "UnQual" (List [
-    App "Ident" (List [String "error"])])]),App "QVarOp" (List [App
-    "UnQual" (List [App "Symbol" (List [String "$"])])]),App
-    "InfixApp" (List [App "Paren" (List [App "InfixApp" (List [App
-    "Lit" (List [App "String" (List [Concat (List [String
-    "Data.gunfold for ",DataName])])]),App "QVarOp" (List [App
-    "UnQual" (List [App "Symbol" (List [String "++"])])]),App "Lit" (
-    List [App "String" (List [String ", unknown index: "])])])]),App
+    String "error"])])]),App "QVarOp" (List [App "UnQual" (List [App
+    "Symbol" (List [String "$"])])]),App "InfixApp" (List [App "Paren"
+    (List [App "InfixApp" (List [App "Lit" (List [App "String" (List [
+    Concat (List [String "Data.gunfold for ",DataName])])]),App
     "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [String
-    "++"])])]),App "App" (List [App "Var" (List [App "UnQual" (List [
-    App "Ident" (List [String "show"])])]),App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "i"])])])])])])]),App
-    "BDecls" (List [List []])])]])])]),App "BDecls" (List [List []])])
-    ]])]),App "InsDecl" (List [App "FunBind" (List [MapCtor (App
-    "Match" (List [App "Ident" (List [String "toConstr"]),List [App
-    "PAsPat" (List [App "Ident" (List [String "x"]),App "PRec" (List [
-    App "UnQual" (List [App "Ident" (List [CtorName])]),List []])])],
-    App "Nothing" (List []),App "UnGuardedRhs" (List [Application (
-    List [App "Var" (List [App "UnQual" (List [App "Ident" (List [
+    "++"])])]),App "Lit" (List [App "String" (List [String
+    ", unknown index: "])])])]),App "QVarOp" (List [App "UnQual" (List
+    [App "Symbol" (List [String "++"])])]),App "App" (List [App "Var"
+    (List [App "UnQual" (List [App "Ident" (List [String "show"])])]),
+    App "Var" (List [App "UnQual" (List [App "Ident" (List [String "i"
+    ])])])])])])]),App "Nothing" (List [])])]])])]),App "Nothing" (
+    List [])])]])]),App "InsDecl" (List [App "FunBind" (List [MapCtor
+    (App "Match" (List [App "Ident" (List [String "toConstr"]),List [
+    App "PAsPat" (List [App "Ident" (List [String "x"]),App "PRec" (
+    List [App "UnQual" (List [App "Ident" (List [CtorName])]),List []]
+    )])],App "Nothing" (List []),App "UnGuardedRhs" (List [Application
+    (List [App "Var" (List [App "UnQual" (List [App "Ident" (List [
     String "indexConstr"])])]),App "Paren" (List [App "App" (List [App
     "Var" (List [App "UnQual" (List [App "Ident" (List [String
     "dataTypeOf"])])]),App "Var" (List [App "UnQual" (List [App
@@ -117,11 +116,11 @@
     "InfixApp" (List [App "Lit" (List [App "Int" (List [CtorIndex])]),
     App "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [String
     "+"])])]),App "Lit" (List [App "Int" (List [Int 1])])])])])]),App
-    "BDecls" (List [List []])]))])]),App "InsDecl" (List [App
-    "FunBind" (List [List [App "Match" (List [App "Ident" (List [
-    String "dataTypeOf"]),List [App "PWildCard" (List [])],App
-    "Nothing" (List []),App "UnGuardedRhs" (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "ty"])])])]),App
+    "Nothing" (List [])]))])]),App "InsDecl" (List [App "FunBind" (
+    List [List [App "Match" (List [App "Ident" (List [String
+    "dataTypeOf"]),List [App "PWildCard" (List [])],App "Nothing" (
+    List []),App "UnGuardedRhs" (List [App "Var" (List [App "UnQual" (
+    List [App "Ident" (List [String "ty"])])])]),App "Just" (List [App
     "BDecls" (List [List [App "PatBind" (List [App "PVar" (List [App
     "Ident" (List [String "ty"])]),App "UnGuardedRhs" (List [
     Application (List [App "Var" (List [App "UnQual" (List [App
@@ -138,7 +137,7 @@
     (List [App "ParenSplice" (List [App "App" (List [App "Var" (List [
     App "UnQual" (List [App "Ident" (List [String "ctorFixity"])])]),
     App "Lit" (List [App "Int" (List [CtorIndex])])])])])]))])])]),App
-    "BDecls" (List [List []])])]])])]])])])]
+    "Nothing" (List [])])]])])])]])])])]
 -- GENERATED STOP
 
 
diff --git a/Data/Derive/DataAbstract.hs b/Data/Derive/DataAbstract.hs
--- a/Data/Derive/DataAbstract.hs
+++ b/Data/Derive/DataAbstract.hs
@@ -32,25 +32,25 @@
     "Nothing" (List []),App "UnGuardedRhs" (List [App "App" (List [App
     "Var" (List [App "UnQual" (List [App "Ident" (List [String "r"])])
     ]),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 "gunfold"])]),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 "Data.gunfold not implemented on abstract data type: ",
-    DataName])])])])]),App "BDecls" (List [List []])])]),App "InsDecl"
-    (List [App "PatBind" (List [App "PVar" (List [App "Ident" (List [
-    String "toConstr"])]),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 "Data.gunfold not implemented on abstract data type: ",
-    DataName])])])])]),App "BDecls" (List [List []])])]),App "InsDecl"
-    (List [App "PatBind" (List [App "PVar" (List [App "Ident" (List [
-    String "dataTypeOf"])]),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 "Data.gunfold not implemented on abstract data type: ",
-    DataName])])])])]),App "BDecls" (List [List []])])])])]
+    "x"])])])])]),App "Nothing" (List [])])]])]),App "InsDecl" (List [
+    App "PatBind" (List [App "PVar" (List [App "Ident" (List [String
+    "gunfold"])]),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
+    "Data.gunfold not implemented on abstract data type: ",DataName])]
+    )])])]),App "Nothing" (List [])])]),App "InsDecl" (List [App
+    "PatBind" (List [App "PVar" (List [App "Ident" (List [String
+    "toConstr"])]),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
+    "Data.gunfold not implemented on abstract data type: ",DataName])]
+    )])])]),App "Nothing" (List [])])]),App "InsDecl" (List [App
+    "PatBind" (List [App "PVar" (List [App "Ident" (List [String
+    "dataTypeOf"])]),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
+    "Data.gunfold not implemented on abstract data type: ",DataName])]
+    )])])]),App "Nothing" (List [])])])])]
 -- GENERATED STOP
 
 custom = customContext context
diff --git a/Data/Derive/Default.hs b/Data/Derive/Default.hs
--- a/Data/Derive/Default.hs
+++ b/Data/Derive/Default.hs
@@ -28,5 +28,5 @@
     [App "UnQual" (List [App "Ident" (List [String "const"])])]),App
     "Var" (List [App "UnQual" (List [App "Ident" (List [String "def"])
     ])]),App "Lit" (List [App "Int" (List [FieldIndex])])])]))])))])])
-    ]),App "BDecls" (List [List []])])])])]
+    ]),App "Nothing" (List [])])])])]
 -- GENERATED STOP
diff --git a/Data/Derive/Enum.hs b/Data/Derive/Enum.hs
--- a/Data/Derive/Enum.hs
+++ b/Data/Derive/Enum.hs
@@ -29,25 +29,24 @@
     [String "toEnum"]),List [App "PLit" (List [App "Signless" (List []
     ),App "Int" (List [CtorIndex])])],App "Nothing" (List []),App
     "UnGuardedRhs" (List [App "RecConstr" (List [App "UnQual" (List [
-    App "Ident" (List [CtorName])]),List []])]),App "BDecls" (List [
-    List []])])),List [App "Match" (List [App "Ident" (List [String
-    "toEnum"]),List [App "PVar" (List [App "Ident" (List [String "n"])
-    ])],App "Nothing" (List []),App "UnGuardedRhs" (List [App
-    "InfixApp" (List [App "Var" (List [App "UnQual" (List [App "Ident"
-    (List [String "error"])])]),App "QVarOp" (List [App "UnQual" (List
-    [App "Symbol" (List [String "$"])])]),Fold (App "InfixApp" (List [
-    Head,App "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [
-    String "++"])])]),Tail])) (List [App "Lit" (List [App "String" (
-    List [String "toEnum "])]),App "App" (List [App "Var" (List [App
+    App "Ident" (List [CtorName])]),List []])]),App "Nothing" (List []
+    )])),List [App "Match" (List [App "Ident" (List [String "toEnum"])
+    ,List [App "PVar" (List [App "Ident" (List [String "n"])])],App
+    "Nothing" (List []),App "UnGuardedRhs" (List [App "InfixApp" (List
+    [App "Var" (List [App "UnQual" (List [App "Ident" (List [String
+    "error"])])]),App "QVarOp" (List [App "UnQual" (List [App "Symbol"
+    (List [String "$"])])]),Fold (App "InfixApp" (List [Head,App
+    "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [String
+    "++"])])]),Tail])) (List [App "Lit" (List [App "String" (List [
+    String "toEnum "])]),App "App" (List [App "Var" (List [App
     "UnQual" (List [App "Ident" (List [String "show"])])]),App "Var" (
     List [App "UnQual" (List [App "Ident" (List [String "n"])])])]),
     App "Lit" (List [App "String" (List [String ", not defined for "])
     ]),App "Lit" (List [App "String" (List [DataName])])])])]),App
-    "BDecls" (List [List []])])]])])]),App "InsDecl" (List [App
-    "FunBind" (List [MapCtor (App "Match" (List [App "Ident" (List [
-    String "fromEnum"]),List [App "PParen" (List [App "PRec" (List [
-    App "UnQual" (List [App "Ident" (List [CtorName])]),List []])])],
-    App "Nothing" (List []),App "UnGuardedRhs" (List [App "Lit" (List
-    [App "Int" (List [CtorIndex])])]),App "BDecls" (List [List []])]))
-    ])])])]
+    "Nothing" (List [])])]])])]),App "InsDecl" (List [App "FunBind" (
+    List [MapCtor (App "Match" (List [App "Ident" (List [String
+    "fromEnum"]),List [App "PParen" (List [App "PRec" (List [App
+    "UnQual" (List [App "Ident" (List [CtorName])]),List []])])],App
+    "Nothing" (List []),App "UnGuardedRhs" (List [App "Lit" (List [App
+    "Int" (List [CtorIndex])])]),App "Nothing" (List [])]))])])])]
 -- GENERATED STOP
diff --git a/Data/Derive/EnumCyclic.hs b/Data/Derive/EnumCyclic.hs
--- a/Data/Derive/EnumCyclic.hs
+++ b/Data/Derive/EnumCyclic.hs
@@ -36,51 +36,51 @@
     [String "toEnum"]),List [App "PLit" (List [App "Signless" (List []
     ),App "Int" (List [CtorIndex])])],App "Nothing" (List []),App
     "UnGuardedRhs" (List [App "RecConstr" (List [App "UnQual" (List [
-    App "Ident" (List [CtorName])]),List []])]),App "BDecls" (List [
-    List []])])),List [App "Match" (List [App "Ident" (List [String
-    "toEnum"]),List [App "PVar" (List [App "Ident" (List [String "n"])
-    ])],App "Nothing" (List []),App "UnGuardedRhs" (List [App
-    "InfixApp" (List [App "Var" (List [App "UnQual" (List [App "Ident"
-    (List [String "error"])])]),App "QVarOp" (List [App "UnQual" (List
-    [App "Symbol" (List [String "$"])])]),Fold (App "InfixApp" (List [
-    Head,App "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [
-    String "++"])])]),Tail])) (List [App "Lit" (List [App "String" (
-    List [String "toEnum "])]),App "App" (List [App "Var" (List [App
+    App "Ident" (List [CtorName])]),List []])]),App "Nothing" (List []
+    )])),List [App "Match" (List [App "Ident" (List [String "toEnum"])
+    ,List [App "PVar" (List [App "Ident" (List [String "n"])])],App
+    "Nothing" (List []),App "UnGuardedRhs" (List [App "InfixApp" (List
+    [App "Var" (List [App "UnQual" (List [App "Ident" (List [String
+    "error"])])]),App "QVarOp" (List [App "UnQual" (List [App "Symbol"
+    (List [String "$"])])]),Fold (App "InfixApp" (List [Head,App
+    "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [String
+    "++"])])]),Tail])) (List [App "Lit" (List [App "String" (List [
+    String "toEnum "])]),App "App" (List [App "Var" (List [App
     "UnQual" (List [App "Ident" (List [String "show"])])]),App "Var" (
     List [App "UnQual" (List [App "Ident" (List [String "n"])])])]),
     App "Lit" (List [App "String" (List [Concat (List [String
-    ", not defined for ",DataName])])])])])]),App "BDecls" (List [List
-    []])])]])])]),App "InsDecl" (List [App "FunBind" (List [MapCtor (
-    App "Match" (List [App "Ident" (List [String "fromEnum"]),List [
-    App "PParen" (List [App "PRec" (List [App "UnQual" (List [App
-    "Ident" (List [CtorName])]),List []])])],App "Nothing" (List []),
-    App "UnGuardedRhs" (List [App "Lit" (List [App "Int" (List [
-    CtorIndex])])]),App "BDecls" (List [List []])]))])]),App "InsDecl"
-    (List [App "FunBind" (List [List [App "Match" (List [App "Ident" (
-    List [String "succ"]),List [App "PVar" (List [App "Ident" (List [
-    String "a"])])],App "Nothing" (List []),App "UnGuardedRhs" (List [
-    App "If" (List [App "InfixApp" (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "b"])])]),App "QVarOp" (
-    List [App "UnQual" (List [App "Symbol" (List [String "=="])])]),
-    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 "App" (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "toEnum"])])]),App "Lit"
-    (List [App "Int" (List [Int 0])])]),App "App" (List [App "Var" (
-    List [App "UnQual" (List [App "Ident" (List [String "toEnum"])])])
-    ,App "Paren" (List [App "InfixApp" (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "b"])])]),App "QVarOp" (
-    List [App "UnQual" (List [App "Symbol" (List [String "+"])])]),App
-    "Lit" (List [App "Int" (List [Int 1])])])])])])]),App "BDecls" (
+    ", not defined for ",DataName])])])])])]),App "Nothing" (List [])]
+    )]])])]),App "InsDecl" (List [App "FunBind" (List [MapCtor (App
+    "Match" (List [App "Ident" (List [String "fromEnum"]),List [App
+    "PParen" (List [App "PRec" (List [App "UnQual" (List [App "Ident"
+    (List [CtorName])]),List []])])],App "Nothing" (List []),App
+    "UnGuardedRhs" (List [App "Lit" (List [App "Int" (List [CtorIndex]
+    )])]),App "Nothing" (List [])]))])]),App "InsDecl" (List [App
+    "FunBind" (List [List [App "Match" (List [App "Ident" (List [
+    String "succ"]),List [App "PVar" (List [App "Ident" (List [String
+    "a"])])],App "Nothing" (List []),App "UnGuardedRhs" (List [App
+    "If" (List [App "InfixApp" (List [App "Var" (List [App "UnQual" (
+    List [App "Ident" (List [String "b"])])]),App "QVarOp" (List [App
+    "UnQual" (List [App "Symbol" (List [String "=="])])]),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 "App" (List [App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [String "toEnum"])])]),App "Lit" (List [App "Int" (
+    List [Int 0])])]),App "App" (List [App "Var" (List [App "UnQual" (
+    List [App "Ident" (List [String "toEnum"])])]),App "Paren" (List [
+    App "InfixApp" (List [App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [String "b"])])]),App "QVarOp" (List [App "UnQual" (
+    List [App "Symbol" (List [String "+"])])]),App "Lit" (List [App
+    "Int" (List [Int 1])])])])])])]),App "Just" (List [App "BDecls" (
     List [List [App "PatBind" (List [App "PVar" (List [App "Ident" (
     List [String "b"])]),App "UnGuardedRhs" (List [App "App" (List [
     App "Var" (List [App "UnQual" (List [App "Ident" (List [String
     "fromEnum"])])]),App "Var" (List [App "UnQual" (List [App "Ident"
-    (List [String "a"])])])])]),App "BDecls" (List [List []])])]])])]]
-    )]),App "InsDecl" (List [App "FunBind" (List [List [App "Match" (
-    List [App "Ident" (List [String "pred"]),List [App "PVar" (List [
-    App "Ident" (List [String "a"])])],App "Nothing" (List []),App
+    (List [String "a"])])])])]),App "Nothing" (List [])])]])])])]])]),
+    App "InsDecl" (List [App "FunBind" (List [List [App "Match" (List
+    [App "Ident" (List [String "pred"]),List [App "PVar" (List [App
+    "Ident" (List [String "a"])])],App "Nothing" (List []),App
     "UnGuardedRhs" (List [App "If" (List [App "InfixApp" (List [App
     "Var" (List [App "UnQual" (List [App "Ident" (List [String "b"])])
     ]),App "QVarOp" (List [App "UnQual" (List [App "Symbol" (List [
@@ -95,10 +95,11 @@
     "InfixApp" (List [App "Var" (List [App "UnQual" (List [App "Ident"
     (List [String "b"])])]),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 "b"])]),App
-    "UnGuardedRhs" (List [App "App" (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "fromEnum"])])]),App
-    "Var" (List [App "UnQual" (List [App "Ident" (List [String "a"])])
-    ])])]),App "BDecls" (List [List []])])]])])]])])])]
+    List [Int 1])])])])])])]),App "Just" (List [App "BDecls" (List [
+    List [App "PatBind" (List [App "PVar" (List [App "Ident" (List [
+    String "b"])]),App "UnGuardedRhs" (List [App "App" (List [App
+    "Var" (List [App "UnQual" (List [App "Ident" (List [String
+    "fromEnum"])])]),App "Var" (List [App "UnQual" (List [App "Ident"
+    (List [String "a"])])])])]),App "Nothing" (List [])])]])])])]])])]
+    )]
 -- GENERATED STOP
diff --git a/Data/Derive/Eq.hs b/Data/Derive/Eq.hs
--- a/Data/Derive/Eq.hs
+++ b/Data/Derive/Eq.hs
@@ -45,8 +45,8 @@
     "Var" (List [App "UnQual" (List [App "Ident" (List [Concat (List [
     String "y",ShowInt FieldIndex])])])])])),List [App "Con" (List [
     App "UnQual" (List [App "Ident" (List [String "True"])])])]]))]),
-    App "BDecls" (List [List []])])),List [App "Match" (List [App
-    "Symbol" (List [String "=="]),List [App "PWildCard" (List []),App
+    App "Nothing" (List [])])),List [App "Match" (List [App "Symbol" (
+    List [String "=="]),List [App "PWildCard" (List []),App
     "PWildCard" (List [])],App "Nothing" (List []),App "GuardedRhss" (
     List [List [App "GuardedRhs" (List [List [App "Qualifier" (List [
     App "InfixApp" (List [App "App" (List [App "Var" (List [App
@@ -56,5 +56,5 @@
     [App "UnQual" (List [App "Symbol" (List [String ">"])])]),App
     "Lit" (List [App "Int" (List [Int 1])])])])],App "Con" (List [App
     "UnQual" (List [App "Ident" (List [String "False"])])])])]]),App
-    "BDecls" (List [List []])])]])])])])]
+    "Nothing" (List [])])]])])])])]
 -- GENERATED STOP
diff --git a/Data/Derive/Fold.hs b/Data/Derive/Fold.hs
--- a/Data/Derive/Fold.hs
+++ b/Data/Derive/Fold.hs
@@ -51,7 +51,7 @@
          | otherwise = []
     where
         n = "fold" ++ title (dataDeclName d)
-        f i c = Match sl (name n) pat Nothing (UnGuardedRhs bod) (BDecls [])
+        f i c = Match sl (name n) pat Nothing (UnGuardedRhs bod) Nothing
             where pat = replicate i PWildCard ++ [pVar "f"] ++ replicate (length (dataDeclCtors d) - i - 1) PWildCard ++
                         [PParen $ PApp (qname $ ctorDeclName c) (map pVar vars)]
                   bod = apps (var "f") (map var vars)
diff --git a/Data/Derive/Foldable.hs b/Data/Derive/Foldable.hs
--- a/Data/Derive/Foldable.hs
+++ b/Data/Derive/Foldable.hs
@@ -50,6 +50,6 @@
         , traversalId     = App (var "flip") (var "const")
         , traverseTuple   =         foldr (.:) $ var "id"
         , traverseCtor    = const $ foldr (.:) $ var "id"
-        , traverseFunc    = \pat rhs -> Match sl (name "") [pVar "_f", pVar "b", pat] Nothing (UnGuardedRhs $ appP rhs (var "b")) (BDecls [])
+        , traverseFunc    = \pat rhs -> Match sl (name "") [pVar "_f", pVar "b", pat] Nothing (UnGuardedRhs $ appP rhs (var "b")) Nothing
         }
     where a .: b = InfixApp (paren a) (qvop ".") (paren b)
diff --git a/Data/Derive/From.hs b/Data/Derive/From.hs
--- a/Data/Derive/From.hs
+++ b/Data/Derive/From.hs
@@ -46,12 +46,12 @@
         typ = TyFun (dataDeclType d)
             (tyTuple $ map snd $ ctorDeclFields c)
 
-        match = Match sl (name from) [pat] Nothing (UnGuardedRhs rhs) (BDecls [])
+        match = Match sl (name from) [pat] Nothing (UnGuardedRhs rhs) Nothing
         pat = (length vars == 0 ? id $ PParen) $ PApp (qname n) (map pVar vars)
         vars = take (length $ ctorDeclFields c) $ map ((:) 'x' . show) [1..]
         rhs = valTuple $ map var vars
 
-        defMatch = Match sl (name from) [PWildCard] Nothing (UnGuardedRhs err) (BDecls [])
+        defMatch = Match sl (name from) [PWildCard] Nothing (UnGuardedRhs err) Nothing
         err = App (var "error") $ Lit $ String $ from ++ " failed, not a " ++ n
 
 
diff --git a/Data/Derive/Functor.hs b/Data/Derive/Functor.hs
--- a/Data/Derive/Functor.hs
+++ b/Data/Derive/Functor.hs
@@ -49,7 +49,7 @@
 functorTraversal = defaultTraversalType
         { traversalName   = qname "fmap"
         , traverseArrow   = Just functorForArrowType
-        , traverseFunc    = \pat rhs -> Match sl (name "") [pVar "_f", pat] Nothing (UnGuardedRhs rhs) (BDecls [])
+        , traverseFunc    = \pat rhs -> Match sl (name "") [pVar "_f", pat] Nothing (UnGuardedRhs rhs) Nothing
         }
 
 functorForArrowType :: Exp -> Exp -> Exp
diff --git a/Data/Derive/Instance/Arities.hs b/Data/Derive/Instance/Arities.hs
--- a/Data/Derive/Instance/Arities.hs
+++ b/Data/Derive/Instance/Arities.hs
@@ -6,7 +6,6 @@
 import Data.Derive.Class.Arities
 import Data.Derive.Internal.Instance
 
- 
 instance Data d_type => Arities d_type where
         arities _
           = [const (d_ctorArity d_ctor) (d_ctorValue d_ctor :: d_type) |
diff --git a/Data/Derive/Is.hs b/Data/Derive/Is.hs
--- a/Data/Derive/Is.hs
+++ b/Data/Derive/Is.hs
@@ -29,5 +29,5 @@
     where
         nam = "is" ++ ctorDeclName c
         
-        match = Match sl (name nam) [PParen $ PRec (qname $ ctorDeclName c) []] Nothing (UnGuardedRhs $ con "True") (BDecls [])
-        defMatch = Match sl (name nam) [PWildCard] Nothing (UnGuardedRhs $ con "False") (BDecls [])
+        match = Match sl (name nam) [PParen $ PRec (qname $ ctorDeclName c) []] Nothing (UnGuardedRhs $ con "True") Nothing
+        defMatch = Match sl (name nam) [PWildCard] Nothing (UnGuardedRhs $ con "False") Nothing
diff --git a/Data/Derive/JSON.hs b/Data/Derive/JSON.hs
--- a/Data/Derive/JSON.hs
+++ b/Data/Derive/JSON.hs
@@ -48,22 +48,22 @@
     [App "PVar" (List [App "Ident" (List [String "x"])])]])])],App
     "Nothing" (List []),App "UnGuardedRhs" (List [App "SpliceExp" (
     List [App "ParenSplice" (List [App "Var" (List [App "UnQual" (List
-    [App "Ident" (List [String "readJSON"])])])])])]),App "BDecls" (
-    List [List []])]),App "Match" (List [App "Ident" (List [String
-    "readJSON"]),List [App "PWildCard" (List [])],App "Nothing" (List
-    []),App "UnGuardedRhs" (List [App "App" (List [App "Con" (List [
-    App "UnQual" (List [App "Ident" (List [String "Error"])])]),App
-    "Lit" (List [App "String" (List [String "..."])])])]),App "BDecls"
-    (List [List []])])]])]),App "InsDecl" (List [App "FunBind" (List [
-    MapCtor (App "Match" (List [App "Ident" (List [String "showJSON"])
-    ,List [App "PParen" (List [App "PApp" (List [App "UnQual" (List [
-    App "Ident" (List [CtorName])]),MapField (App "PVar" (List [App
+    [App "Ident" (List [String "readJSON"])])])])])]),App "Nothing" (
+    List [])]),App "Match" (List [App "Ident" (List [String "readJSON"
+    ]),List [App "PWildCard" (List [])],App "Nothing" (List []),App
+    "UnGuardedRhs" (List [App "App" (List [App "Con" (List [App
+    "UnQual" (List [App "Ident" (List [String "Error"])])]),App "Lit"
+    (List [App "String" (List [String "..."])])])]),App "Nothing" (
+    List [])])]])]),App "InsDecl" (List [App "FunBind" (List [MapCtor
+    (App "Match" (List [App "Ident" (List [String "showJSON"]),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 [App
     "SpliceExp" (List [App "ParenSplice" (List [App "App" (List [App
     "Var" (List [App "UnQual" (List [App "Ident" (List [String
     "showJSON"])])]),App "Lit" (List [App "Int" (List [CtorIndex])])])
-    ])])]),App "BDecls" (List [List []])]))])])])]
+    ])])]),App "Nothing" (List [])]))])])])]
 -- GENERATED STOP
 
 -- ^ 'Derivation' for 'JSON'
@@ -106,7 +106,7 @@
   in
     H.Case (var "fromJSObject" `H.App` var "x") $
     map mkReadCtor (dataDeclCtors d) ++
-    [H.Alt H.sl H.PWildCard (H.UnGuardedRhs readError) (H.BDecls [])]
+    [H.Alt H.sl H.PWildCard (H.UnGuardedRhs readError) Nothing]
 
 mkReadCtor :: CtorDecl -> Alt
 mkReadCtor c = let
@@ -117,7 +117,7 @@
          | otherwise = mkReadPlain cn fs
   in
     H.Alt sl (H.PList [H.PTuple H.Boxed [strP cn, pVar "y"]])
-         (H.UnGuardedRhs body) (H.BDecls [])
+         (H.UnGuardedRhs body) Nothing
 
 mkReadRecord :: String -> FieldDecl -> Exp
 mkReadRecord cn fs = H.Do $
@@ -125,7 +125,7 @@
           (var "return" `H.App` var "y")] ++
     [H.LetStmt $ H.BDecls [H.PatBind sl (pVar "d")
           (H.UnGuardedRhs $ var "fromJSObject" `H.App` var "z")
-          (H.BDecls [])]] ++
+          Nothing]] ++
     zipWith (mkReadRecordField cn) (pVars "x" fs) fs ++
     mkReadTrailer cn fs
 
diff --git a/Data/Derive/Monoid.hs b/Data/Derive/Monoid.hs
--- a/Data/Derive/Monoid.hs
+++ b/Data/Derive/Monoid.hs
@@ -35,11 +35,11 @@
     [App "UnQual" (List [App "Ident" (List [String "const"])])]),App
     "Var" (List [App "UnQual" (List [App "Ident" (List [String
     "mempty"])])]),App "Lit" (List [App "Int" (List [FieldIndex])])])]
-    ))])))])])]),App "BDecls" (List [List []])])]),App "InsDecl" (List
-    [App "FunBind" (List [Concat (List [MapCtor (App "Match" (List [
-    App "Ident" (List [String "mappend"]),List [App "PParen" (List [
-    App "PApp" (List [App "UnQual" (List [App "Ident" (List [CtorName]
-    )]),MapField (App "PVar" (List [App "Ident" (List [Concat (List [
+    ))])))])])]),App "Nothing" (List [])])]),App "InsDecl" (List [App
+    "FunBind" (List [Concat (List [MapCtor (App "Match" (List [App
+    "Ident" (List [String "mappend"]),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 "PParen" (List [App
     "PApp" (List [App "UnQual" (List [App "Ident" (List [CtorName])]),
     MapField (App "PVar" (List [App "Ident" (List [Concat (List [
@@ -51,9 +51,9 @@
     "Var" (List [App "UnQual" (List [App "Ident" (List [Concat (List [
     String "x",ShowInt FieldIndex])])])]),App "Var" (List [App
     "UnQual" (List [App "Ident" (List [Concat (List [String "y",
-    ShowInt FieldIndex])])])])])]))]))]),App "BDecls" (List [List []])
-    ])),List [App "Match" (List [App "Ident" (List [String "mappend"])
-    ,List [App "PWildCard" (List []),App "PWildCard" (List [])],App
+    ShowInt FieldIndex])])])])])]))]))]),App "Nothing" (List [])])),
+    List [App "Match" (List [App "Ident" (List [String "mappend"]),
+    List [App "PWildCard" (List []),App "PWildCard" (List [])],App
     "Nothing" (List []),App "GuardedRhss" (List [List [App
     "GuardedRhs" (List [List [App "Qualifier" (List [App "InfixApp" (
     List [App "App" (List [App "Var" (List [App "UnQual" (List [App
@@ -65,5 +65,5 @@
     "UnQual" (List [App "Ident" (List [String "error"])])]),App "Lit"
     (List [App "String" (List [Concat (List [String
     "Monoid.mappend: Different constructors for ",DataName])])])])])]]
-    ),App "BDecls" (List [List []])])]])])])])]
+    ),App "Nothing" (List [])])]])])])])]
 -- GENERATED STOP
diff --git a/Data/Derive/NFData.hs b/Data/Derive/NFData.hs
--- a/Data/Derive/NFData.hs
+++ b/Data/Derive/NFData.hs
@@ -30,6 +30,6 @@
     "UnQual" (List [App "Ident" (List [String "rnf"])])]),App "Var" (
     List [App "UnQual" (List [App "Ident" (List [Concat (List [String
     "x",ShowInt FieldIndex])])])])])),List [App "Con" (List [App
-    "Special" (List [App "UnitCon" (List [])])])]]))]),App "BDecls" (
-    List [List []])]))])])])]
+    "Special" (List [App "UnitCon" (List [])])])]]))]),App "Nothing" (
+    List [])]))])])])]
 -- GENERATED STOP
diff --git a/Data/Derive/Ord.hs b/Data/Derive/Ord.hs
--- a/Data/Derive/Ord.hs
+++ b/Data/Derive/Ord.hs
@@ -37,59 +37,59 @@
     List [App "Var" (List [App "UnQual" (List [App "Ident" (List [
     String "check"])])]),App "Var" (List [App "UnQual" (List [App
     "Ident" (List [String "a"])])]),App "Var" (List [App "UnQual" (
-    List [App "Ident" (List [String "b"])])])])]),App "BDecls" (List [
-    List [App "FunBind" (List [Concat (List [MapCtor (App "Match" (
-    List [App "Ident" (List [String "check"]),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 "PParen" (List [App
-    "PApp" (List [App "UnQual" (List [App "Ident" (List [CtorName])]),
-    MapField (App "PVar" (List [App "Ident" (List [Concat (List [
-    String "y",ShowInt FieldIndex])])]))])])],App "Nothing" (List []),
-    App "UnGuardedRhs" (List [Fold (App "InfixApp" (List [Tail,App
-    "QVarOp" (List [App "UnQual" (List [App "Ident" (List [String
-    "_then"])])]),Head])) (Concat (List [List [App "Con" (List [App
-    "UnQual" (List [App "Ident" (List [String "EQ"])])])],Reverse (
-    MapField (Application (List [App "Var" (List [App "UnQual" (List [
-    App "Ident" (List [String "compare"])])]),App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [Concat (List [String "x",
-    ShowInt FieldIndex])])])]),App "Var" (List [App "UnQual" (List [
-    App "Ident" (List [Concat (List [String "y",ShowInt FieldIndex])])
-    ])])])))]))]),App "BDecls" (List [List []])])),List [App "Match" (
-    List [App "Ident" (List [String "check"]),List [App "PVar" (List [
-    App "Ident" (List [String "x"])]),App "PVar" (List [App "Ident" (
-    List [String "y"])])],App "Nothing" (List []),App "GuardedRhss" (
-    List [List [App "GuardedRhs" (List [List [App "Qualifier" (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])])])])],Application (List [
-    App "Var" (List [App "UnQual" (List [App "Ident" (List [String
-    "compare"])])]),App "Paren" (List [App "App" (List [App "Var" (
-    List [App "UnQual" (List [App "Ident" (List [String "tag"])])]),
-    App "Var" (List [App "UnQual" (List [App "Ident" (List [String "x"
-    ])])])])]),App "Paren" (List [App "App" (List [App "Var" (List [
-    App "UnQual" (List [App "Ident" (List [String "tag"])])]),App
-    "Var" (List [App "UnQual" (List [App "Ident" (List [String "y"])])
-    ])])])])])]]),App "BDecls" (List [List []])])]])]),App "FunBind" (
-    List [List [App "Match" (List [App "Ident" (List [String "_then"])
-    ,List [App "PApp" (List [App "UnQual" (List [App "Ident" (List [
-    String "EQ"])]),List []]),App "PVar" (List [App "Ident" (List [
-    String "x"])])],App "Nothing" (List []),App "UnGuardedRhs" (List [
-    App "Var" (List [App "UnQual" (List [App "Ident" (List [String "x"
-    ])])])]),App "BDecls" (List [List []])]),App "Match" (List [App
-    "Ident" (List [String "_then"]),List [App "PVar" (List [App
-    "Ident" (List [String "x"])]),App "PWildCard" (List [])],App
-    "Nothing" (List []),App "UnGuardedRhs" (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [String "x"])])])]),App "BDecls"
-    (List [List []])])]]),App "FunBind" (List [MapCtor (App "Match" (
-    List [App "Ident" (List [String "tag"]),List [App "PParen" (List [
-    App "PRec" (List [App "UnQual" (List [App "Ident" (List [CtorName]
-    )]),List []])])],App "Nothing" (List []),App "UnGuardedRhs" (List
-    [App "ExpTypeSig" (List [App "Lit" (List [App "Int" (List [
-    CtorIndex])]),App "TyCon" (List [App "UnQual" (List [App "Ident" (
-    List [String "Int"])])])])]),App "BDecls" (List [List []])]))])]])
-    ])]])])])]
+    List [App "Ident" (List [String "b"])])])])]),App "Just" (List [
+    App "BDecls" (List [List [App "FunBind" (List [Concat (List [
+    MapCtor (App "Match" (List [App "Ident" (List [String "check"]),
+    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 "PParen" (List [App "PApp" (List [App "UnQual" (List [App
+    "Ident" (List [CtorName])]),MapField (App "PVar" (List [App
+    "Ident" (List [Concat (List [String "y",ShowInt FieldIndex])])]))]
+    )])],App "Nothing" (List []),App "UnGuardedRhs" (List [Fold (App
+    "InfixApp" (List [Tail,App "QVarOp" (List [App "UnQual" (List [App
+    "Ident" (List [String "_then"])])]),Head])) (Concat (List [List [
+    App "Con" (List [App "UnQual" (List [App "Ident" (List [String
+    "EQ"])])])],Reverse (MapField (Application (List [App "Var" (List
+    [App "UnQual" (List [App "Ident" (List [String "compare"])])]),App
+    "Var" (List [App "UnQual" (List [App "Ident" (List [Concat (List [
+    String "x",ShowInt FieldIndex])])])]),App "Var" (List [App
+    "UnQual" (List [App "Ident" (List [Concat (List [String "y",
+    ShowInt FieldIndex])])])])])))]))]),App "Nothing" (List [])])),
+    List [App "Match" (List [App "Ident" (List [String "check"]),List
+    [App "PVar" (List [App "Ident" (List [String "x"])]),App "PVar" (
+    List [App "Ident" (List [String "y"])])],App "Nothing" (List []),
+    App "GuardedRhss" (List [List [App "GuardedRhs" (List [List [App
+    "Qualifier" (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])])])])],
+    Application (List [App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [String "compare"])])]),App "Paren" (List [App "App"
+    (List [App "Var" (List [App "UnQual" (List [App "Ident" (List [
+    String "tag"])])]),App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [String "x"])])])])]),App "Paren" (List [App "App" (
+    List [App "Var" (List [App "UnQual" (List [App "Ident" (List [
+    String "tag"])])]),App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [String "y"])])])])])])])]]),App "Nothing" (List [])
+    ])]])]),App "FunBind" (List [List [App "Match" (List [App "Ident"
+    (List [String "_then"]),List [App "PApp" (List [App "UnQual" (List
+    [App "Ident" (List [String "EQ"])]),List []]),App "PVar" (List [
+    App "Ident" (List [String "x"])])],App "Nothing" (List []),App
+    "UnGuardedRhs" (List [App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [String "x"])])])]),App "Nothing" (List [])]),App
+    "Match" (List [App "Ident" (List [String "_then"]),List [App
+    "PVar" (List [App "Ident" (List [String "x"])]),App "PWildCard" (
+    List [])],App "Nothing" (List []),App "UnGuardedRhs" (List [App
+    "Var" (List [App "UnQual" (List [App "Ident" (List [String "x"])])
+    ])]),App "Nothing" (List [])])]]),App "FunBind" (List [MapCtor (
+    App "Match" (List [App "Ident" (List [String "tag"]),List [App
+    "PParen" (List [App "PRec" (List [App "UnQual" (List [App "Ident"
+    (List [CtorName])]),List []])])],App "Nothing" (List []),App
+    "UnGuardedRhs" (List [App "ExpTypeSig" (List [App "Lit" (List [App
+    "Int" (List [CtorIndex])]),App "TyCon" (List [App "UnQual" (List [
+    App "Ident" (List [String "Int"])])])])]),App "Nothing" (List [])]
+    ))])]])])])]])])])]
 -- GENERATED STOP
diff --git a/Data/Derive/Read.hs b/Data/Derive/Read.hs
--- a/Data/Derive/Read.hs
+++ b/Data/Derive/Read.hs
@@ -102,8 +102,7 @@
     List [CtorIndex])]),App "Con" (List [App "UnQual" (List [App
     "Ident" (List [CtorName])])])])])])])]),App "Var" (List [App
     "UnQual" (List [App "Ident" (List [String "r"])])])])),List [App
-    "List" (List [List []])]]))]),App "BDecls" (List [List []])])]])])
-    ])]
+    "List" (List [List []])]]))]),App "Nothing" (List [])])]])])])]
 -- GENERATED STOP
 
 custom = customSplice splice
diff --git a/Data/Derive/Serial.hs b/Data/Derive/Serial.hs
--- a/Data/Derive/Serial.hs
+++ b/Data/Derive/Serial.hs
@@ -36,30 +36,30 @@
     "Var" (List [App "UnQual" (List [App "Ident" (List [Concat (List [
     String "cons",ShowInt CtorArity])])])]),App "Con" (List [App
     "UnQual" (List [App "Ident" (List [CtorName])])])]))))]),App
-    "BDecls" (List [List []])])]),App "InsDecl" (List [App "FunBind" (
-    List [List [App "Match" (List [App "Ident" (List [String
-    "coseries"]),List [App "PVar" (List [App "Ident" (List [String
-    "rs"])]),App "PVar" (List [App "Ident" (List [String "d"])])],App
-    "Nothing" (List []),App "UnGuardedRhs" (List [App "ListComp" (List
-    [App "Lambda" (List [List [App "PVar" (List [App "Ident" (List [
-    String "t"])])],App "Case" (List [App "Var" (List [App "UnQual" (
-    List [App "Ident" (List [String "t"])])]),MapCtor (App "Alt" (List
-    [App "PApp" (List [App "UnQual" (List [App "Ident" (List [CtorName
-    ])]),MapField (App "PVar" (List [App "Ident" (List [Concat (List [
+    "Nothing" (List [])])]),App "InsDecl" (List [App "FunBind" (List [
+    List [App "Match" (List [App "Ident" (List [String "coseries"]),
+    List [App "PVar" (List [App "Ident" (List [String "rs"])]),App
+    "PVar" (List [App "Ident" (List [String "d"])])],App "Nothing" (
+    List []),App "UnGuardedRhs" (List [App "ListComp" (List [App
+    "Lambda" (List [List [App "PVar" (List [App "Ident" (List [String
+    "t"])])],App "Case" (List [App "Var" (List [App "UnQual" (List [
+    App "Ident" (List [String "t"])])]),MapCtor (App "Alt" (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 "UnGuardedRhs" (List [
     Application (Concat (List [List [App "Var" (List [App "UnQual" (
     List [App "Ident" (List [Concat (List [String "t",ShowInt
     CtorIndex])])])])],MapField (App "Var" (List [App "UnQual" (List [
     App "Ident" (List [Concat (List [String "x",ShowInt FieldIndex])])
-    ])]))]))]),App "BDecls" (List [List []])]))])]),MapCtor (App
-    "QualStmt" (List [App "Generator" (List [App "PVar" (List [App
-    "Ident" (List [Concat (List [String "t",ShowInt CtorIndex])])]),
-    App "InfixApp" (List [Application (List [App "Var" (List [App
-    "UnQual" (List [App "Ident" (List [Concat (List [String "alts",
-    ShowInt CtorArity])])])]),App "Var" (List [App "UnQual" (List [App
-    "Ident" (List [String "rs"])])]),App "Var" (List [App "UnQual" (
-    List [App "Ident" (List [String "d"])])])]),App "QVarOp" (List [
-    App "UnQual" (List [App "Ident" (List [String "const"])])]),App
-    "RecConstr" (List [App "UnQual" (List [App "Ident" (List [CtorName
-    ])]),List []])])])]))])]),App "BDecls" (List [List []])])]])])])]
+    ])]))]))]),App "Nothing" (List [])]))])]),MapCtor (App "QualStmt"
+    (List [App "Generator" (List [App "PVar" (List [App "Ident" (List
+    [Concat (List [String "t",ShowInt CtorIndex])])]),App "InfixApp" (
+    List [Application (List [App "Var" (List [App "UnQual" (List [App
+    "Ident" (List [Concat (List [String "alts",ShowInt CtorArity])])])
+    ]),App "Var" (List [App "UnQual" (List [App "Ident" (List [String
+    "rs"])])]),App "Var" (List [App "UnQual" (List [App "Ident" (List
+    [String "d"])])])]),App "QVarOp" (List [App "UnQual" (List [App
+    "Ident" (List [String "const"])])]),App "RecConstr" (List [App
+    "UnQual" (List [App "Ident" (List [CtorName])]),List []])])])]))])
+    ]),App "Nothing" (List [])])]])])])]
 -- GENERATED STOP
diff --git a/Data/Derive/Serialize.hs b/Data/Derive/Serialize.hs
--- a/Data/Derive/Serialize.hs
+++ b/Data/Derive/Serialize.hs
@@ -72,63 +72,63 @@
     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
diff --git a/Data/Derive/Show.hs b/Data/Derive/Show.hs
--- a/Data/Derive/Show.hs
+++ b/Data/Derive/Show.hs
@@ -55,7 +55,7 @@
     "SpliceExp" (List [App "ParenSplice" (List [App "App" (List [App
     "Var" (List [App "UnQual" (List [App "Ident" (List [String "show"]
     )])]),App "Lit" (List [App "Int" (List [CtorIndex])])])])])]),App
-    "BDecls" (List [List []])]))])])])]
+    "Nothing" (List [])]))])])])]
 -- GENERATED STOP
 
 -- Left is a literal string, Right is a variable
diff --git a/Data/Derive/Traversable.hs b/Data/Derive/Traversable.hs
--- a/Data/Derive/Traversable.hs
+++ b/Data/Derive/Traversable.hs
@@ -48,7 +48,7 @@
         , traversalPlus  = fail "variable used in multiple positions in a data type"
         , traverseTuple  = \args -> liftAN (Con $ Special $ TupleCon Unboxed $ length args) args
         , traverseCtor   = \ctor -> liftAN (con ctor)
-        , traverseFunc   = \pat rhs -> Match sl (name "") [pVar "_f", pat] Nothing (UnGuardedRhs rhs) (BDecls [])
+        , traverseFunc   = \pat rhs -> Match sl (name "") [pVar "_f", pat] Nothing (UnGuardedRhs rhs) Nothing
         }
 
 liftAN :: Exp -> [Exp] -> Exp
diff --git a/Data/Derive/Typeable.hs b/Data/Derive/Typeable.hs
--- a/Data/Derive/Typeable.hs
+++ b/Data/Derive/Typeable.hs
@@ -76,7 +76,7 @@
 mkTypeable :: String -> DataDecl -> [Decl]
 mkTypeable modu d =
     [TypeSig sl [name fun] (tyCon "TyCon")] ++
-    [PatBind sl (pVar fun) (UnGuardedRhs bod) (BDecls []) |
+    [PatBind sl (pVar fun) (UnGuardedRhs bod) Nothing |
         let bod = apps (var "mkTyCon3") [Lit $ String "package", Lit $ String modu, Lit $ String nam]] ++
     [inst [] (showN n) [tyCon nam] [PWildCard] $ apps (var "mkTyConApp") [var fun, List []]] ++
     [inst [ClassA (qname "Typeable") [v] | v <- tvs] i [TyParen $ tyApp (tyCon nam) tvs] [] $ var $ "typeOf" ++ i ++ "Default"
diff --git a/Data/Derive/UniplateDirect.hs b/Data/Derive/UniplateDirect.hs
--- a/Data/Derive/UniplateDirect.hs
+++ b/Data/Derive/UniplateDirect.hs
@@ -107,10 +107,10 @@
         [InsDecl $ InlineSig sl True AlwaysActive (qname $ if uni then "uniplate" else "biplate"), InsDecl ms]]
     where
         ty = grab $ tyRoot from
-        match pat bod = Match sl (Ident $ if uni then "uniplate" else "biplate") [pat] Nothing (UnGuardedRhs bod) (BDecls [])
+        match pat bod = Match sl (Ident $ if uni then "uniplate" else "biplate") [pat] Nothing (UnGuardedRhs bod) Nothing
         ms = if uni || from /= to
              then FunBind $ map (uncurry match) (catMaybes bods) ++ [match (pVar "x") (var "plate" `App` var "x") | any isNothing bods]
-             else PatBind sl (pVar "biplate") (UnGuardedRhs $ var "plateSelf") (BDecls [])
+             else PatBind sl (pVar "biplate") (UnGuardedRhs $ var "plateSelf") Nothing
         bods = run (fromTyParens to) $ mapM (make1 grab) $ substData from ty
 
 
diff --git a/Data/Derive/UniplateTypeable.hs b/Data/Derive/UniplateTypeable.hs
--- a/Data/Derive/UniplateTypeable.hs
+++ b/Data/Derive/UniplateTypeable.hs
@@ -59,8 +59,8 @@
     Concat (List [String "x",ShowInt FieldIndex])])])]))),List [App
     "App" (List [App "Var" (List [App "UnQual" (List [App "Ident" (
     List [String "plate"])])]),App "Con" (List [App "UnQual" (List [
-    App "Ident" (List [CtorName])])])])]]))]),App "BDecls" (List [List
-    []])]))])])]])]
+    App "Ident" (List [CtorName])])])])]]))]),App "Nothing" (List [])]
+    ))])])]])]
 -- GENERATED STOP
 
 
diff --git a/Derive/Generate.hs b/Derive/Generate.hs
--- a/Derive/Generate.hs
+++ b/Derive/Generate.hs
@@ -82,7 +82,7 @@
         pkgName = a
         pkgVersion = if null b then "latest" else tail b
         modu = reps '.' '-' $ prettyPrint $ importModule x
-        nam = case importSpecs x of Just (False,IAbs y:_) -> prettyPrint y ; _ -> name
+        nam = case importSpecs x of Just (False,IAbs _ y:_) -> prettyPrint y ; _ -> name
 
 
 wrap :: Int -> String -> [String]
diff --git a/Language/Haskell.hs b/Language/Haskell.hs
--- a/Language/Haskell.hs
+++ b/Language/Haskell.hs
@@ -92,7 +92,7 @@
             where x2 = Var $ UnQual x
         fExp (Case (ExpTypeSig _ x@Lit{} _) alts) = fExp $ Case x alts
         fExp (Case (Lit x) alts) | good /= [] = head good
-            where good = [z | Alt _ (PLit Signless y) (UnGuardedRhs z) (BDecls []) <- alts, y == x]
+            where good = [z | Alt _ (PLit Signless y) (UnGuardedRhs z) Nothing <- alts, y == x]
         fExp (If x t f)
             | x ~= "True" = t
             | x ~= "False" = f
@@ -124,7 +124,7 @@
 
         fMatch (Match sl nam pat sig (GuardedRhss [GuardedRhs _ [Qualifier x] bod]) decls)
             | x ~= "True" = fMatch $ Match sl nam pat sig (UnGuardedRhs bod) decls
-        fMatch (Match sl nam [PVar x] sig (UnGuardedRhs (Case (Var (UnQual x2)) [Alt _ pat (UnGuardedRhs y) (BDecls [])])) decls)
+        fMatch (Match sl nam [PVar x] sig (UnGuardedRhs (Case (Var (UnQual x2)) [Alt _ pat (UnGuardedRhs y) Nothing])) decls)
             | x == x2 = fMatch $ Match sl nam [PParen pat] sig (UnGuardedRhs y) decls
         fMatch o@(Match a b c d e bind) = fBinds (Match a b (minPat o c) d e) bind
 
@@ -132,19 +132,21 @@
         fDecl (FunBind xs) = FunBind $ filter (not . isGuardFalse) xs
         fDecl x = x
 
-        fBinds context (BDecls bind) | inline /= [] =
-                simplify $ subst (Var $ UnQual from) to $ context $ BDecls $ take i bind ++ drop (i+1) bind
+        fBinds context Nothing = context Nothing
+        fBinds context (Just (BDecls bind)) | inline /= [] =
+                simplify $ subst (Var $ UnQual from) to $ context $
+                    let xs = take i bind ++ drop (i+1) bind in if null xs then Nothing else Just $ BDecls xs
             where
-                f (PatBind _ (PVar x) (UnGuardedRhs bod) (BDecls [])) = [(x,bod)]
-                f (FunBind [Match _ x [PVar v] Nothing (UnGuardedRhs (Paren (App bod (Var v2)))) (BDecls [])])
+                f (PatBind _ (PVar x) (UnGuardedRhs bod) Nothing) = [(x,bod)]
+                f (FunBind [Match _ x [PVar v] Nothing (UnGuardedRhs (Paren (App bod (Var v2)))) Nothing])
                     | UnQual v == v2 = [(x,bod)]
-                f (FunBind [Match sl x pat Nothing (UnGuardedRhs bod) (BDecls [])]) = [(x,Paren $ Lambda sl pat bod)]
+                f (FunBind [Match sl x pat Nothing (UnGuardedRhs bod) Nothing]) = [(x,Paren $ Lambda sl pat bod)]
                 f _ = []
 
                 (i,from,to) = head inline
                 inline = [(i, x, bod)
                          | (i,b) <- zip [0..] bind, (x,bod) <- f b
-                         , isAtom bod || once (Var $ UnQual x) (context $ BDecls bind)]
+                         , isAtom bod || once (Var $ UnQual x) (context $ Just $ BDecls bind)]
         fBinds a y = a y
 
         subst from to = transformBi $ \x -> if x == from then to else x
@@ -235,8 +237,8 @@
 bind s p e = binds s [(p,e)]
 
 binds :: String -> [([Pat], Exp)] -> Decl
-binds n [([],e)] = PatBind sl (pVar n) (UnGuardedRhs e) (BDecls [])
-binds n xs = FunBind [Match sl (name n) p Nothing (UnGuardedRhs e) (BDecls []) | (p,e) <- xs]
+binds n [([],e)] = PatBind sl (pVar n) (UnGuardedRhs e) Nothing
+binds n xs = FunBind [Match sl (name n) p Nothing (UnGuardedRhs e) Nothing | (p,e) <- xs]
 
 
 isDataDecl :: Decl -> Bool
diff --git a/Language/Haskell/Convert.hs b/Language/Haskell/Convert.hs
--- a/Language/Haskell/Convert.hs
+++ b/Language/Haskell/Convert.hs
@@ -181,6 +181,10 @@
 instance Convert HS.Binds [TH.Dec] where
     conv (BDecls x) = c x
 
+instance Convert (Maybe HS.Binds) [TH.Dec] where
+    conv Nothing = []
+    conv (Just x) = c x
+
 instance Convert HS.Pat TH.Pat where
     conv (PParen x) = c x
     conv (PLit Signless x) = LitP (c x)
diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Derive [![Hackage version](https://img.shields.io/hackage/v/derive.svg?style=flat)](https://hackage.haskell.org/package/derive) [![Build Status](https://img.shields.io/travis/ndmitchell/derive.svg?style=flat)](https://travis-ci.org/ndmitchell/derive)
+# Derive [![Hackage version](https://img.shields.io/hackage/v/derive.svg?label=Hackage)](https://hackage.haskell.org/package/derive) [![Build Status](https://img.shields.io/travis/ndmitchell/derive.svg)](https://travis-ci.org/ndmitchell/derive)
 
 
 Data.Derive is a library and a tool for deriving instances for Haskell programs. It is designed to work with custom derivations, SYB and Template Haskell mechanisms. The tool requires GHC, but the generated code is portable to all compilers. We see this tool as a competitor to <a href="http://repetae.net/~john/computer/haskell/DrIFT/">DrIFT</a>.
diff --git a/derive.cabal b/derive.cabal
--- a/derive.cabal
+++ b/derive.cabal
@@ -1,7 +1,7 @@
 cabal-version:  >= 1.6
 build-type:     Default
 name:           derive
-version:        2.5.22
+version:        2.5.23
 build-type:     Simple
 copyright:      Neil Mitchell 2006-2015
 author:         Neil Mitchell <ndmitchell@gmail.com>
@@ -17,10 +17,10 @@
     It is designed to work with custom derivations, SYB and Template Haskell mechanisms.
     The tool requires GHC, but the generated code is portable to all compilers.
     We see this tool as a competitor to DrIFT.
-extra-source-files:
+extra-doc-files:
     README.md
     CHANGES.txt
-tested-with:        GHC==7.10.1, GHC==7.8.4, GHC==7.6.3, GHC==7.4.2
+tested-with:        GHC==7.10.1, GHC==7.8.4, GHC==7.6.3
 
 source-repository head
     type:     git
@@ -34,7 +34,7 @@
         base == 4.*,
         filepath, syb, template-haskell, containers, pretty,
         directory, process, bytestring,
-        haskell-src-exts >= 1.16 && < 1.17,
+        haskell-src-exts >= 1.17 && < 1.18,
         transformers >= 0.2,
         uniplate >= 1.5 && < 1.7
 
