Allow NFData instances for NExpr and NExprLoc on GHC 8.0

This commit is contained in:
John Wiegley 2018-05-10 15:26:37 -07:00
parent b59d6fd62e
commit e06ab95236
No known key found for this signature in database
GPG key ID: C144D8F4F19FE630
2 changed files with 8 additions and 3 deletions

View file

@ -428,6 +428,10 @@ paramName :: Params r -> Maybe VarName
paramName (Param n) = Just n
paramName (ParamSet _ _ n) = n
#if !MIN_VERSION_deepseq(1, 4, 3)
instance NFData NExpr
#endif
$(deriveEq1 ''NExprF)
$(deriveEq1 ''NString)
$(deriveEq1 ''Binding)

View file

@ -108,11 +108,12 @@ type NExprLocF = AnnF SrcSpan NExprF
-- | A nix expression with source location at each subexpression.
type NExprLoc = Fix NExprLocF
#if MIN_VERSION_hashable(1, 2, 5) && MIN_VERSION_deepseq(1, 4, 3)
-- Needs deepseq-1.4.3 because Compose requires NFData1
instance NFData NExprLoc
#if !MIN_VERSION_deepseq(1, 4, 3)
instance (NFData (f (g a)), NFData (g a)) => NFData (Compose f g a)
#endif
instance NFData NExprLoc
#if MIN_VERSION_serialise(0, 2, 0)
instance Serialise NExprLoc
#endif