patch applied (ghc): Use names like '$fOrdInt' for dfuns (and TF instances), rather than '$f21'

Simon Marlow 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'
  Ignore-this: d0b4632cf8ed9e05b67a19aa19ab3e19
  
  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.

    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:
http://darcs.haskell.org/ghc/_darcs/patches/20090716125643-12142-e6fbc3f345e41b88a7c2392e16c6dcb1b55f07ec.gz



More information about the Cvs-ghc mailing list