git.iko.soy/distributed-process
on master help sign in
fixup! TH: Use conT and appT instead of classP
commit1ff972d72135e450fa6f8b079df8a3683df82138 authorBen Gamari <ben@smart-cactus.org> dateWed 6 Jul 2016, 22:56 (10 years ago) parent5e2eb3a
1 file changed+11−8
src/Control/Distributed/Process/Internal/Closure/TH.hs+11−8
src/Control/Distributed/Process/Internal/Closure/TH.hs+11−8
@@ -29,12 +29,14 @@ import Language.Haskell.TH
2929 , Type(AppT, ForallT, VarT, ArrowT)
3030 , Info(VarI)
3131 , TyVarBndr(PlainTV, KindedTV)
32−#if ! MIN_VERSION_template_haskell(2,10,0)
3332 , Pred
34−#endif
35− , varT
33+#if MIN_VERSION_template_haskell(2,10,0)
3634 , conT
3735 , appT
36+#else
37+ , classP
38+#endif
39+ , varT
3840 -- Lifted constructors
3941 -- .. Literals
4042 , stringL
@@ -72,10 +74,6 @@ import Control.Distributed.Process.Serializable
7274 )
7375import Control.Distributed.Process.Internal.Closure.BuiltIn (staticDecode)
7476
75−#if MIN_VERSION_template_haskell(2,10,0)
76−type Pred = Type
77−#endif
78−
7977--------------------------------------------------------------------------------
8078-- User-level API --
8179--------------------------------------------------------------------------------
@@ -262,7 +260,12 @@ generateStatic n xs typ = do
262260 ]
263261 where
264262 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
266269
267270-- | Generate a serialization dictionary with name 'n' for type 'typ'
268271generateDict :: Name -> Type -> Q [Dec]