2 % (c) The AQUA Project, Glasgow University, 1996
4 \section[FieldLabel]{The @FieldLabel@ type}
7 #include "HsVersions.h"
9 module FieldLabel where
13 import Name --( Name{-instance Eq/Outputable-}, nameUnique )
14 import Type ( SYN_IE(Type) )
17 import UniqFM ( SYN_IE(Uniquable) )
22 = FieldLabel Name -- Also used as the Name of the field selector Id
26 type FieldLabelTag = Int
28 mkFieldLabel = FieldLabel
30 firstFieldLabelTag :: FieldLabelTag
31 firstFieldLabelTag = 1
33 allFieldLabelTags :: [FieldLabelTag]
34 allFieldLabelTags = [1..]
36 fieldLabelName (FieldLabel n _ _) = n
37 fieldLabelType (FieldLabel _ ty _) = ty
38 fieldLabelTag (FieldLabel _ _ tag) = tag
40 instance Eq FieldLabel where
41 (FieldLabel n1 _ _) == (FieldLabel n2 _ _) = n1 == n2
43 instance Outputable FieldLabel where
44 ppr sty (FieldLabel n _ _) = ppr sty n
46 instance NamedThing FieldLabel where
47 getName (FieldLabel n _ _) = n
49 instance Uniquable FieldLabel where
50 uniqueOf (FieldLabel n _ _) = nameUnique n