X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2FbasicTypes%2FOccName.lhs;h=f33c71660118fe0a7e8b965678311a704b67de90;hb=2dad6b8373e3079ff11c4d40e2512755b525172b;hp=d2c28f1b8ed1b6c06c85924dc5e93d63f984f10a;hpb=8701267283521ae27e52d2b90c5d240255e5fd76;p=ghc-hetmet.git diff --git a/ghc/compiler/basicTypes/OccName.lhs b/ghc/compiler/basicTypes/OccName.lhs index d2c28f1..f33c716 100644 --- a/ghc/compiler/basicTypes/OccName.lhs +++ b/ghc/compiler/basicTypes/OccName.lhs @@ -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}