Use functional dependencies
[ghc-prim.git] / GHC / Generics.hs
index 7f5b86f..d2170d9 100644 (file)
@@ -34,6 +34,9 @@ module GHC.Generics  (
   , Datatype(..), Constructor(..), Selector(..), NoSelector
   , Fixity(..), Associativity(..), Arity(..), prec
 
+  -- * Representation type families
+  , Rep0, Rep1
+
   -- * Representable type classes
   , Representable0(..), Representable1(..)
 
@@ -45,7 +48,7 @@ module GHC.Generics  (
 -}
   ) where
   
-import {-# SOURCE #-} GHC.Types
+import {-# SOURCE #-} GHC.Types -- ([](..), Int, Char, Bool(..))
 
 --------------------------------------------------------------------------------
 -- Representation types
@@ -173,16 +176,16 @@ data Associativity =  LeftAssociative
 -- | Representable types of kind *
 class Representable0 a rep where
   -- | Convert from the datatype to its representation
-  from0  :: a -> rep x
+  from0  :: a -> Rep0 a x
   -- | Convert from the representation to the datatype
-  to0    :: rep x -> a
+  to0    :: Rep0 a x -> a
 
 -- | Representable types of kind * -> *
 class Representable1 f rep where
   -- | Convert from the datatype to its representation
-  from1  :: f a -> rep a
+  from1  :: f a -> Rep1 f a
   -- | Convert from the representation to the datatype
-  to1    :: rep a -> f a
+  to1    :: Rep1 f a -> f a
 
 --------------------------------------------------------------------------------
 -- Representation for base types