Use functional dependencies
authorjpm@cs.uu.nl <unknown>
Thu, 6 Jan 2011 14:44:37 +0000 (14:44 +0000)
committerjpm@cs.uu.nl <unknown>
Thu, 6 Jan 2011 14:44:37 +0000 (14:44 +0000)
GHC/Generics.hs
GHC/Types.hs

index cf61c6c..d2170d9 100644 (file)
@@ -20,7 +20,6 @@ data (:*:) a b = a :*: b
 {-# OPTIONS_GHC -XTypeSynonymInstances   #-}
 {-# OPTIONS_GHC -XTypeOperators          #-}
 {-# OPTIONS_GHC -XKindSignatures         #-}
-{-# OPTIONS_GHC -XTypeFamilies           #-}
 
 module GHC.Generics  (
   -- * Generic representation types
@@ -49,7 +48,7 @@ module GHC.Generics  (
 -}
   ) where
   
-import {-# SOURCE #-} GHC.Types
+import {-# SOURCE #-} GHC.Types -- ([](..), Int, Char, Bool(..))
 
 --------------------------------------------------------------------------------
 -- Representation types
@@ -175,9 +174,7 @@ data Associativity =  LeftAssociative
 
 
 -- | Representable types of kind *
-class Representable0 a where
-  -- | Representation type
-  type Rep0 a :: * -> *
+class Representable0 a rep where
   -- | Convert from the datatype to its representation
   from0  :: a -> Rep0 a x
   -- | Convert from the representation to the datatype
@@ -185,8 +182,6 @@ class Representable0 a where
 
 -- | Representable types of kind * -> *
 class Representable1 f rep where
-  -- | Representation type
-  type Rep1 f :: * -> *
   -- | Convert from the datatype to its representation
   from1  :: f a -> Rep1 f a
   -- | Convert from the representation to the datatype
index 59ce386..0d7d7f8 100644 (file)
@@ -20,7 +20,7 @@ module GHC.Types (Bool(..), Char(..), Int(..), Float(..), Double(..), IO(..)) wh
 
 import GHC.Prim
 -- We need Inl etc behind the scenes for the type definitions
-import GHC.Generics ()
+import GHC.Generics () -- JPM: Do we really need this?
 
 infixr 5 :