[project @ 1999-11-01 17:09:54 by simonpj]
[ghc-hetmet.git] / ghc / compiler / basicTypes / OccName.lhs
index d2c28f1..1720506 100644 (file)
@@ -58,7 +58,7 @@ code the encoding operation is not performed on each occurrence.
 These type synonyms help documentation.
 
 \begin{code}
-type UserFS     = FAST_STRING  -- As the user typed it
+type UserFS    = FAST_STRING   -- As the user typed it
 type EncodedFS = FAST_STRING   -- Encoded form
 
 type UserString = String       -- As the user typed it
@@ -304,18 +304,16 @@ mkSuperDictSelOcc index cls_occ
 
 
 \begin{code}
-mkDFunOcc :: OccName   -- class, eg "Ord"
-         -> OccName    -- tycon (or something convenient from the instance type)
-                       --      eg "Maybe"
-         -> Int        -- Unique to distinguish dfuns which share the previous two
-                       --      eg 3
-         -> OccName    -- "dOrdMaybe3"
-
-mkDFunOcc cls_occ tycon_occ index
-  = mk_deriv VarName "$f" (show_index ++ cls_str ++ tycon_str)
+mkDFunOcc :: EncodedString     -- Typically the class and type glommed together e.g. "OrdMaybe"
+         -> Int                -- Unique to distinguish dfuns which share the previous two
+                               --      eg 3
+         -- The requirement is that the (string,index) pair be unique in this module
+
+         -> OccName    -- "$fOrdMaybe3"
+
+mkDFunOcc string index
+  = mk_deriv VarName "$f" (show_index ++ string)
   where
-    cls_str   = occNameString cls_occ
-    tycon_str = occNameString tycon_occ
     show_index | index == 0 = ""
               | otherwise  = show index
 \end{code}