mirror of
https://github.com/tweag/distributed-closure.git
synced 2024-11-22 03:06:47 +03:00
fix: compatibility with template-haskell 2.16
In template-haskell 2.16, the signature of PlainTV change, requiring an additional argument of type Specificity. This accounts for the change, while maintaining backward compatibility.
This commit is contained in:
parent
9fc0095eb8
commit
b92e75ec81
@ -117,7 +117,14 @@ withStatic = (>>= go)
|
||||
f <- mangleName <$> TH.newName "static_helper"
|
||||
fbody <- foldr (\_ body -> [| \Dict -> $body |]) [| Dict |] cxt
|
||||
let tyf = foldr (\a b -> TH.ArrowT `TH.AppT` a `TH.AppT` b) retsig dictsigs
|
||||
sigf = TH.SigD f (TH.ForallT (map TH.PlainTV (fvT tyf)) [] tyf)
|
||||
#if MIN_VERSION_template_haskell(2,16,0)
|
||||
specifiedPlainTV :: TH.Name -> TH.TyVarBndr TH.Specificity
|
||||
specifiedPlainTV n = TH.PlainTV n TH.SpecifiedSpec
|
||||
#else
|
||||
specifiedPlainTV :: TH.Name -> TH.TyVarBndr
|
||||
specifiedPlainTV = TH.PlainTV
|
||||
#endif
|
||||
sigf = TH.SigD f (TH.ForallT (map specifiedPlainTV (fvT tyf)) [] tyf)
|
||||
declf = TH.ValD (TH.VarP f) (TH.NormalB fbody) []
|
||||
methods <- (:[]) <$>
|
||||
TH.valD
|
||||
|
Loading…
Reference in New Issue
Block a user