aboutsummaryrefslogtreecommitdiff
path: root/haddock-api
diff options
context:
space:
mode:
authorSimon Marlow <smarlow@fb.com>2016-07-22 02:55:04 -0700
committerBen Gamari <ben@smart-cactus.org>2016-08-02 15:57:30 +0200
commitd9bb5fc3823d720783e31e1e95ed5ed35c721b7b (patch)
treee94e0f1fb4a4184380fc13fdeb670c8d2c61d086 /haddock-api
parent011c9e32d0449205e82479408dca2b4391e13fcf (diff)
Disable NFData instances for GHC types when GHC >= 8.0.2
(cherry picked from commit a3309e797c42dae9bccdeb17ce52fcababbaff8a)
Diffstat (limited to 'haddock-api')
-rw-r--r--haddock-api/src/Haddock/Types.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/haddock-api/src/Haddock/Types.hs b/haddock-api/src/Haddock/Types.hs
index eacf4473..17037781 100644
--- a/haddock-api/src/Haddock/Types.hs
+++ b/haddock-api/src/Haddock/Types.hs
@@ -1,4 +1,6 @@
-{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving, TypeFamilies, RecordWildCards #-}
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE DeriveDataTypeable, DeriveFunctor, DeriveFoldable, DeriveTraversable, StandaloneDeriving #-}
+{-# LANGUAGE TypeFamilies, RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
-----------------------------------------------------------------------------
-- |
@@ -447,10 +449,12 @@ instance (NFData a, NFData mod)
DocExamples a -> a `deepseq` ()
DocHeader a -> a `deepseq` ()
-
+#if !MIN_VERSION_ghc(8,0,2)
+-- These were added to GHC itself in 8.0.2
instance NFData Name where rnf x = seq x ()
instance NFData OccName where rnf x = seq x ()
instance NFData ModuleName where rnf x = seq x ()
+#endif
instance NFData id => NFData (Header id) where
rnf (Header a b) = a `deepseq` b `deepseq` ()