Exploit now-working default-method INLINE pragmas for Data.Bits
[ghc-base.git] / Data / Tuple.hs
index 4002c73..22b9f78 100644 (file)
@@ -1,4 +1,7 @@
 {-# OPTIONS_GHC -XNoImplicitPrelude #-}
+{-# OPTIONS_GHC -fno-warn-unused-imports #-}
+{-# OPTIONS_GHC -fno-warn-orphans #-}
+-- XXX -fno-warn-unused-imports needed for the GHC.Tuple import below. Sigh.
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Data.Tuple
@@ -38,13 +41,19 @@ module Data.Tuple
     where
 
 #ifdef __GLASGOW_HASKELL__
+
 import GHC.Base
--- XXX The standalone deriving clauses fail with
---     The data constructors of `(,)' are not all in scope
---       so you cannot derive an instance for it
---     In the stand-alone deriving instance for `Eq (a, b)'
--- if we don't import GHC.Tuple
+-- We need to depend on GHC.Base so that
+-- a) so that we get GHC.Bool, GHC.Classes, GHC.Ordering
+
+-- b) so that GHC.Base.inline is available, which is used
+--    when expanding instance declarations
+
 import GHC.Tuple
+-- We must import GHC.Tuple, to ensure sure that the 
+-- data constructors of `(,)' are in scope when we do
+-- the standalone deriving instance for Eq (a,b) etc
+
 #endif  /* __GLASGOW_HASKELL__ */
 
 #ifdef __NHC__
@@ -70,6 +79,10 @@ import Prelude
   )
 #endif
 
+#ifdef __GLASGOW_HASKELL__
+import GHC.Unit ()
+#endif
+
 default ()              -- Double isn't available yet
 
 #ifdef __GLASGOW_HASKELL__
@@ -87,6 +100,7 @@ instance Ord () where
     min () () = ()
     compare () () = EQ
 
+#ifndef __HADDOCK__
 deriving instance (Eq  a, Eq  b) => Eq  (a, b)
 deriving instance (Ord a, Ord b) => Ord (a, b)
 deriving instance (Eq  a, Eq  b, Eq  c) => Eq  (a, b, c)
@@ -151,6 +165,7 @@ deriving instance (Eq a, Eq b, Eq c, Eq d, Eq e, Eq f, Eq g,
 deriving instance (Ord a, Ord b, Ord c, Ord d, Ord e, Ord f, Ord g,
                    Ord h, Ord i, Ord j, Ord k, Ord l, Ord m, Ord n, Ord o)
                => Ord (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)
+#endif  /* !__HADDOCK__ */
 #endif  /* __GLASGOW_HASKELL__ */
 
 -- ---------------------------------------------------------------------------