X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2FbasicTypes%2FOccName.lhs;h=4968463c99ba87de611cb7fe21fcd11a1a64ed23;hb=9c54ee0c9e25617b2a9ad4cdd9d3a6354e2edc0f;hp=9952ac20a9a125069842701d86bf9767536290b2;hpb=4f55ec2c7e78aa836b91ebc57ddd74675d92372c;p=ghc-hetmet.git diff --git a/compiler/basicTypes/OccName.lhs b/compiler/basicTypes/OccName.lhs index 9952ac2..4968463 100644 --- a/compiler/basicTypes/OccName.lhs +++ b/compiler/basicTypes/OccName.lhs @@ -31,7 +31,8 @@ module OccName ( mkSpecOcc, mkForeignExportOcc, mkGenOcc1, mkGenOcc2, mkDataTOcc, mkDataCOcc, mkDataConWorkerOcc, mkSuperDictSelOcc, mkLocalOcc, mkMethodOcc, mkInstTyTcOcc, - mkInstTyCoOcc, + mkInstTyCoOcc, mkEqPredCoOcc, + mkCloOcc, mkCloTyCoOcc, -- ** Deconstruction occNameFS, occNameString, occNameSpace, @@ -78,7 +79,6 @@ import Data.Char -- Unicode TODO: put isSymbol in libcompat #if __GLASGOW_HASKELL__ > 604 -import Data.Char ( isSymbol ) #else isSymbol = const False #endif @@ -92,8 +92,8 @@ isSymbol = const False %************************************************************************ \begin{code} -data NameSpace = VarName -- Variables, including "source" data constructors - | DataName -- "Real" data constructors +data NameSpace = VarName -- Variables, including "real" data constructors + | DataName -- "Source" data constructors | TvName -- Type variables | TcClsName -- Type constructors and classes; Haskell has them -- in the same name space for now. @@ -176,8 +176,9 @@ instance Eq OccName where (OccName sp1 s1) == (OccName sp2 s2) = s1 == s2 && sp1 == sp2 instance Ord OccName where - compare (OccName sp1 s1) (OccName sp2 s2) = (s1 `compare` s2) `thenCmp` - (sp1 `compare` sp2) + -- Compares lexicographically, *not* by Unique of the string + compare (OccName sp1 s1) (OccName sp2 s2) + = (s1 `compare` s2) `thenCmp` (sp1 `compare` sp2) \end{code} @@ -401,6 +402,7 @@ Here's our convention for splitting up the interface file name space: $w... workers :T... compiler-generated tycons for dictionaries :D... ...ditto data cons + :Co... ...ditto coercions $sf.. specialised version of f in encoded form these appear as Zdfxxx etc @@ -444,6 +446,7 @@ mkSpecOcc = mk_simple_deriv varName "$s" mkForeignExportOcc = mk_simple_deriv varName "$f" mkNewTyCoOcc = mk_simple_deriv tcName ":Co" mkInstTyCoOcc = mk_simple_deriv tcName ":Co" -- derived from rep ty +mkEqPredCoOcc = mk_simple_deriv tcName "$co" -- Generic derivable classes mkGenOcc1 = mk_simple_deriv varName "$gfrom" @@ -455,6 +458,10 @@ mkGenOcc2 = mk_simple_deriv varName "$gto" mkDataTOcc = mk_simple_deriv varName "$t" mkDataCOcc = mk_simple_deriv varName "$c" +-- Closure conversion +mkCloOcc = mk_simple_deriv varName "$CC_" +mkCloTyCoOcc = mk_simple_deriv tcName ":CC_" + mk_simple_deriv sp px occ = mk_deriv sp px (occNameString occ) -- Data constructor workers are made by setting the name space