git.iko.soy/distributed-process
on master help sign in
fixup! TH: Use conT and appT instead of classP
ecdd703Ben Gamari
src/Control/Distributed/Process/Internal/Closure/TH.hs+11−8
@@ -29,12 +29,14 @@ import Language.Haskell.TH
29 , Type(AppT, ForallT, VarT, ArrowT)
29 , Type(AppT, ForallT, VarT, ArrowT)
30 , Info(VarI)
30 , Info(VarI)
31 , TyVarBndr(PlainTV, KindedTV)
31 , TyVarBndr(PlainTV, KindedTV)
32−#if ! MIN_VERSION_template_haskell(2,10,0)
33 , Pred
32 , Pred
34−#endif
33+#if MIN_VERSION_template_haskell(2,10,0)
35− , varT
36 , conT
34 , conT
37 , appT
35 , appT
36+#else
37+ , classP
38+#endif
39+ , varT
38 -- Lifted constructors
40 -- Lifted constructors
39 -- .. Literals
41 -- .. Literals
40 , stringL
42 , stringL
@@ -72,10 +74,6 @@ import Control.Distributed.Process.Serializable
72 )
74 )
73import Control.Distributed.Process.Internal.Closure.BuiltIn (staticDecode)
75import 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-- User-level API --
78-- User-level API --
81--------------------------------------------------------------------------------
79--------------------------------------------------------------------------------
@@ -262,7 +260,12 @@ generateStatic n xs typ = do
262 ]
260 ]
263 where
261 where
264 typeable :: TyVarBndr -> Q Pred
262 typeable :: TyVarBndr -> Q Pred
263+ typeable tv =
264+#if MIN_VERSION_template_haskell(2,10,0)
265− typeable tv = conT (mkName "Typeable") `appT` varT (tyVarBndrName tv)
265+ conT (mkName "Typeable") `appT` varT (tyVarBndrName tv)
266+#else
267+ classP (mkName "Typeable") [varT (tyVarBndrName tv)]
268+#endif
266
269
267-- | Generate a serialization dictionary with name 'n' for type 'typ'
270-- | Generate a serialization dictionary with name 'n' for type 'typ'
268generateDict :: Name -> Type -> Q [Dec]
271generateDict :: Name -> Type -> Q [Dec]