Use names like '$fOrdInt' for dfuns (and TF instances), rather than '$f21'
authorSimon Marlow <marlowsd@gmail.com>
Thu, 16 Jul 2009 12:56:43 +0000 (12:56 +0000)
committerSimon Marlow <marlowsd@gmail.com>
Thu, 16 Jul 2009 12:56:43 +0000 (12:56 +0000)
commita6f29db07ac47b8a924a65c7e07ce73bc491d0e5
tree271e659503c467fb9a16cf99e551e2b39fcd38b2
parent5aeae7aaf9f831a97a55eea61f553795f23a2d1b
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
disambiguation strategy.
compiler/basicTypes/OccName.lhs
compiler/typecheck/TcEnv.lhs
compiler/typecheck/TcRnMonad.lhs
compiler/typecheck/TcRnTypes.lhs
compiler/typecheck/TcTyClsDecls.lhs