Data.Generics.Basics is GHC-only
[ghc-base.git] / Data / Complex.hs
index 20448c7..0f8d13b 100644 (file)
@@ -43,8 +43,9 @@ module Data.Complex
 
 import Prelude
 
-#ifndef __NHC__
 import Data.Typeable
+#ifdef __GLASGOW_HASKELL__
+import Data.Generics.Basics( Data )
 #endif
 
 #ifdef __HUGS__
@@ -64,7 +65,11 @@ infix  6  :+
 data (RealFloat a) => Complex a
   = !a :+ !a   -- ^ forms a complex number from its real and imaginary
                -- rectangular components.
-  deriving (Eq, Read, Show)
+# if __GLASGOW_HASKELL__
+       deriving (Eq, Show, Read, Data)
+# else
+       deriving (Eq, Show, Read)
+# endif
 
 -- -----------------------------------------------------------------------------
 -- Functions over Complex
@@ -120,10 +125,8 @@ phase (x:+y)        = atan2 y x
 -- -----------------------------------------------------------------------------
 -- Instances of Complex
 
-#ifndef __NHC__
 #include "Typeable.h"
 INSTANCE_TYPEABLE1(Complex,complexTc,"Complex")
-#endif
 
 instance  (RealFloat a) => Num (Complex a)  where
     {-# SPECIALISE instance Num (Complex Float) #-}