Merge branch 'master' of http://darcs.haskell.org/packages/base into ghc-generics
authorJose Pedro Magalhaes <jpm@cs.uu.nl>
Mon, 2 May 2011 19:13:19 +0000 (21:13 +0200)
committerJose Pedro Magalhaes <jpm@cs.uu.nl>
Mon, 2 May 2011 19:13:19 +0000 (21:13 +0200)
Solved conflicts:
GHC/Int.hs

GHC/Base.lhs
GHC/Int.hs

index be1b57b..1a5ce0d 100644 (file)
@@ -97,7 +97,8 @@ module GHC.Base
         (
         module GHC.Base,
         module GHC.Classes,
-        module GHC.Generics,
+        --module GHC.Generics,        -- JPM: We no longer export GHC.Generics
+                                      -- by default to avoid name clashes
         module GHC.Ordering,
         module GHC.Types,
         module GHC.Prim,        -- Re-export GHC.Prim and GHC.Err, to avoid lots
@@ -107,7 +108,8 @@ module GHC.Base
 
 import GHC.Types
 import GHC.Classes
-import GHC.Generics
+-- JPM: Since we don't export it, we don't need to import GHC.Generics
+--import GHC.Generics
 import GHC.Ordering
 import GHC.Prim
 import {-# SOURCE #-} GHC.Show
index 7a42bb3..146bf66 100644 (file)
@@ -1,4 +1,5 @@
-{-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash #-}
+{-# LANGUAGE CPP, NoImplicitPrelude, BangPatterns, MagicHash, 
+             StandaloneDeriving #-}
 {-# OPTIONS_HADDOCK hide #-}
 -----------------------------------------------------------------------------
 -- |
@@ -41,6 +42,8 @@ import GHC.Err
 import GHC.Word hiding (uncheckedShiftL64#, uncheckedShiftRL64#)
 import GHC.Show
 import GHC.Float ()     -- for RealFrac methods
+-- For defining instances for the new generic deriving mechanism
+--import GHC.Generics (Arity(..), Associativity(..), Fixity(..))
 
 ------------------------------------------------------------------------
 -- type Int8
@@ -908,6 +911,30 @@ instance Ix Int64 where
     unsafeIndex (m,_) i = fromIntegral i - fromIntegral m
     inRange (m,n) i     = m <= i && i <= n
 
+------------------------------------------------------------------------
+-- Generic deriving
+------------------------------------------------------------------------
+
+-- We need instances for some basic datatypes, but some of those use Int,
+-- so we have to put the instances here
+{-
+deriving instance Eq Arity
+deriving instance Eq Associativity
+deriving instance Eq Fixity
+
+deriving instance Ord Arity
+deriving instance Ord Associativity
+deriving instance Ord Fixity
+
+deriving instance Read Arity
+deriving instance Read Associativity
+deriving instance Read Fixity
+
+deriving instance Show Arity
+deriving instance Show Associativity
+deriving instance Show Fixity
+-}
+
 {-
 Note [Order of tests]
 
@@ -1031,4 +1058,3 @@ so the
     y == (-1) && x == minBound
 order gives us better code in the common case.
 -}
-