[project @ 1999-07-26 15:31:01 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / FieldLabel.lhs
index 683d8fd..a0a85dd 100644 (file)
@@ -1,5 +1,5 @@
 %
-% (c) The AQUA Project, Glasgow University, 1996
+% (c) The AQUA Project, Glasgow University, 1996-1998
 %
 \section[FieldLabel]{The @FieldLabel@ type}
 
@@ -8,9 +8,9 @@ module FieldLabel where
 
 #include "HsVersions.h"
 
-import Name            ( Name{-instance Eq/Outputable-}, NamedThing(..), nameUnique )
-import Type            ( Type )
+import {-# SOURCE #-}  TypeRep( Type ) -- FieldLabel is compiled very early
 
+import Name            ( Name{-instance Eq/Outputable-}, NamedThing(..), nameUnique )
 import Outputable
 import Unique           ( Uniquable(..) )
 \end{code}
@@ -24,6 +24,8 @@ data FieldLabel
                                -- The type in the FieldLabel for op1 will be simply (a->a).
 
                FieldLabelTag   -- Indicates position within constructor
+                               -- (starting with firstFieldLabelTag)
+                               --
                                -- If the same field occurs in more than one constructor
                                -- then it'll have a separate FieldLabel on each occasion,
                                -- but with a single name (and presumably the same type!)
@@ -36,7 +38,7 @@ firstFieldLabelTag :: FieldLabelTag
 firstFieldLabelTag = 1
 
 allFieldLabelTags :: [FieldLabelTag]
-allFieldLabelTags = [1..]
+allFieldLabelTags = [firstFieldLabelTag..]
 
 fieldLabelName (FieldLabel n _  _)   = n
 fieldLabelType (FieldLabel _ ty _)   = ty
@@ -52,5 +54,5 @@ instance NamedThing FieldLabel where
     getName (FieldLabel n _ _) = n
 
 instance Uniquable FieldLabel where
-    uniqueOf (FieldLabel n _ _) = nameUnique n
+    getUnique (FieldLabel n _ _) = nameUnique n
 \end{code}