@@ -29,12 +29,14 @@ import Language.Haskell.TH
29
29
, Type (AppT , ForallT , VarT , ArrowT )
30
30
, Info (VarI )
31
31
, TyVarBndr (PlainTV , KindedTV )
32
- #if ! MIN_VERSION_template_haskell(2,10,0)
33
32
, Pred
34
- #endif
35
- , varT
33
+ #if MIN_VERSION_template_haskell(2,10,0)
36
34
, conT
37
35
, appT
36
+ #else
37
+ , classP
38
+ #endif
39
+ , varT
38
40
-- Lifted constructors
39
41
-- .. Literals
40
42
, stringL
@@ -72,10 +74,6 @@ import Control.Distributed.Process.Serializable
72
74
)
73
75
import Control.Distributed.Process.Internal.Closure.BuiltIn (staticDecode )
74
76
75
- #if MIN_VERSION_template_haskell(2,10,0)
76
- type Pred = Type
77
- #endif
78
-
79
77
--------------------------------------------------------------------------------
80
78
-- User-level API --
81
79
--------------------------------------------------------------------------------
@@ -262,7 +260,12 @@ generateStatic n xs typ = do
262
260
]
263
261
where
264
262
typeable :: TyVarBndr -> Q Pred
265
- typeable tv = conT (mkName " Typeable" ) `appT` varT (tyVarBndrName tv)
263
+ typeable tv =
264
+ #if MIN_VERSION_template_haskell(2,10,0)
265
+ conT (mkName " Typeable" ) `appT` varT (tyVarBndrName tv)
266
+ #else
267
+ classP (mkName " Typeable" ) [varT (tyVarBndrName tv)]
268
+ #endif
266
269
267
270
-- | Generate a serialization dictionary with name 'n' for type 'typ'
268
271
generateDict :: Name -> Type -> Q [Dec ]
0 commit comments