patch applied (ghc): Use names like '$fOrdInt' for dfuns (and TF
instances), rather than '$f21'
marlowsd at gmail.com
Thu Jul 16 10:44:37 EDT 2009
Thu Jul 16 05:56:43 PDT 2009 Simon Marlow <marlowsd at gmail.com>
* Use names like '$fOrdInt' for dfuns (and TF instances), rather than '$f21'
2 reasons for this:
- compilation is more predictable. Adding or removing an instance
is less likely to force unnecessary recompilation due to
renumbering other dfun names.
- it makes it easier to read Core / C-- / asm
The names aren't completely deterministic. To do that, we'd have to
include package and module names, which would make the symbol names
long and reduce readability. So the compromise is that if there's a
clash, we disambiguate by adding an integer suffix. This is fairly
unlikely in practice unless you're using overlapping instances.
Type family instances are handled in the same way, with the same
M ./compiler/basicTypes/OccName.lhs -11 +20
M ./compiler/typecheck/TcEnv.lhs -14 +11
M ./compiler/typecheck/TcRnMonad.lhs -7 +10
M ./compiler/typecheck/TcRnTypes.lhs -8 +2
M ./compiler/typecheck/TcTyClsDecls.lhs -2 +2
View patch online:
More information about the Cvs-ghc