1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
diff --git a/src/DeriveArbitrary.hs b/src/DeriveArbitrary.hs
index fc94945..6f2d77f 100644
--- a/src/DeriveArbitrary.hs
+++ b/src/DeriveArbitrary.hs
@@ -3,2 +3,3 @@
{-# LANGUAGE LambdaCase #-}
+{-# LANGUAGE CPP #-}
module DeriveArbitrary (
@@ -39,2 +40,8 @@ import Data.List
+#if MIN_VERSION_template_haskell(2,11,0)
+# define TH211MBKIND _maybe_kind
+#else
+# define TH211MBKIND
+#endif
+
-- | Build the arbitrary function with makeArbs
@@ -80,3 +87,3 @@ deriveArbitrary t = do
case inf of
- TyConI (DataD _ _ params constructors _) -> do
+ TyConI (DataD _ _ params TH211MBKIND constructors _) -> do
let ns = map varT $ paramNames params
@@ -111,3 +118,3 @@ deriveArbitrary t = do
where go n = $(gos 'go 'n)|]
- TyConI (NewtypeD _ _ params con _) -> do
+ TyConI (NewtypeD _ _ params TH211MBKIND con _) -> do
let ns = map varT $ paramNames params
@@ -281,3 +288,3 @@ customG name = do
- TyConI (DataD _ _ params constructors _) ->
+ TyConI (DataD _ _ params TH211MBKIND constructors _) ->
let fnm = mkName "prob_gen" -- "customGen_" ++ (map (\x -> if x == '.' then '_' else
diff --git a/src/DeriveFixable.hs b/src/DeriveFixable.hs
index ec8b8be..83593e6 100644
--- a/src/DeriveFixable.hs
+++ b/src/DeriveFixable.hs
@@ -1,2 +1,3 @@
{-# Language TemplateHaskell, ConstraintKinds, FlexibleInstances, FlexibleContexts, IncoherentInstances, MultiParamTypeClasses #-}
+{-# Language CPP #-}
@@ -15,2 +16,8 @@ import Control.Monad.Trans.State
+#if MIN_VERSION_template_haskell(2,11,0)
+# define TH211MBKIND _maybe_kind
+#else
+# define TH211MBKIND
+#endif
+
--The state is composed of identifiers
@@ -147,3 +154,3 @@ mkFix i v a t = do ti <- reify t
case ti of
- TyConI (DataD _ _ params tcons _) -> do
+ TyConI (DataD _ _ params TH211MBKIND tcons _) -> do
let cstuff = map getStuff tcons
@@ -155,3 +162,3 @@ mkFix i v a t = do ti <- reify t
case ii of
- TyConI (DataD _ _ ip _ _) -> do
+ TyConI (DataD _ _ ip TH211MBKIND _ _) -> do
let ivars = map (varT . getParName) ip
@@ -180,3 +187,3 @@ mkFix i v a t = do ti <- reify t
gg = $(mkFixBody matches) |]
- TyConI (NewtypeD _ _ ip _ _) -> do
+ TyConI (NewtypeD _ _ ip TH211MBKIND _ _) -> do
let ivars = map (varT . getParName) ip
diff --git a/src/DeriveMutation.hs b/src/DeriveMutation.hs
index ae58345..7494c50 100644
--- a/src/DeriveMutation.hs
+++ b/src/DeriveMutation.hs
@@ -3,2 +3,3 @@
{-# LANGUAGE FlexibleInstances,UndecidableInstances#-}
+{-# LANGUAGE CPP #-}
module DeriveMutation where
@@ -17,2 +18,9 @@ import Data.List
import Megadeth.Prim
+
+#if MIN_VERSION_template_haskell(2,11,0)
+# define TH211MBKIND _maybe_kind
+#else
+# define TH211MBKIND
+#endif
+
--import Mutation
@@ -100,3 +108,3 @@ devMutation name customGen = do
TyConI (TySynD _ _ ty) -> return [] -- devMutation (headOf ty) Nothing
- TyConI (DataD _ _ params constructors _) -> do
+ TyConI (DataD _ _ params TH211MBKIND constructors _) -> do
let fnm = mkName $ "mutt" -- ++ (showName name)
|