Skip to content

Commit c11843f

Browse files
Simon Marlowhvr
authored andcommitted
Disable NFData instances for GHC types when GHC >= 8.0.2
(cherry picked from commit a3309e7) (cherry picked from commit d9bb5fc)
1 parent 8d82690 commit c11843f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

haddock-api/src/Haddock/Types.hs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving, TypeFamilies, RecordWildCards #-}
1+
{-# LANGUAGE CPP #-}
2+
{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving #-}
3+
{-# LANGUAGE TypeFamilies, RecordWildCards #-}
24
{-# OPTIONS_GHC -fno-warn-orphans #-}
35
-----------------------------------------------------------------------------
46
-- |
@@ -447,10 +449,12 @@ instance (NFData a, NFData mod)
447449
DocExamples a -> a `deepseq` ()
448450
DocHeader a -> a `deepseq` ()
449451

450-
452+
#if !MIN_VERSION_ghc(8,0,2)
453+
-- These were added to GHC itself in 8.0.2
451454
instance NFData Name where rnf x = seq x ()
452455
instance NFData OccName where rnf x = seq x ()
453456
instance NFData ModuleName where rnf x = seq x ()
457+
#endif
454458

455459
instance NFData id => NFData (Header id) where
456460
rnf (Header a b) = a `deepseq` b `deepseq` ()

0 commit comments

Comments
 (0)