Skip to content

Commit a3309e7

Browse files
Simon Marlowsimonmar
authored andcommitted
Disable NFData instances for GHC types when GHC >= 8.2
1 parent cdc81a1 commit a3309e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

haddock-api/src/Haddock/Types.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving, TypeFamilies, RecordWildCards #-}
1+
{-# LANGUAGE CPP, DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving, TypeFamilies, RecordWildCards #-}
22
{-# LANGUAGE FlexibleContexts #-}
33
{-# LANGUAGE UndecidableInstances #-} -- Note [Pass sensitive types]
44
-- in module GHC.PlaceHolder
@@ -451,10 +451,12 @@ instance (NFData a, NFData mod)
451451
DocExamples a -> a `deepseq` ()
452452
DocHeader a -> a `deepseq` ()
453453

454-
454+
#if __GLASGOW_HASKELL__ < 801
455+
-- These were added to GHC itself in 8.2.1
455456
instance NFData Name where rnf x = seq x ()
456457
instance NFData OccName where rnf x = seq x ()
457458
instance NFData ModuleName where rnf x = seq x ()
459+
#endif
458460

459461
instance NFData id => NFData (Header id) where
460462
rnf (Header a b) = a `deepseq` b `deepseq` ()

0 commit comments

Comments
 (0)