Mon Dec  8 09:35:25 PST 2008  [EMAIL PROTECTED]
  * Inject implicit bindings after CoreTidy, not before Simplify
  
  Originally I inject the "implicit bindings" (record selectors, class
  method selectors, data con wrappers...) after CoreTidy.  However, in a
  misguided attempt to fix Trac #2070, I moved the injection point to
  before the Simplifier, so that record selectors would be optimised by
  the simplifier.
  
  This was misguided because record selectors (indeed all implicit bindings)
  are GlobalIds, whose IdInfo is meant to be frozen.  But the Simplifier,
  and other Core-to-Core optimisations, merrily change the IdInfo.  That 
  ultimately made Trac #2844 happen, where a record selector got arity 2,
  but the GlobalId (which importing scopes re-construct from the class decl
  rather than reading from the interface file) has arity 1.
  
  So this patch moves the injection back to CoreTidy. Happily #2070 should
  still be OK because we now use CoreSubst.simpleOptExpr on the unfoldings
  for implict things, which gets rid of the most gratuitous infelicities.
  
  Still, there's a strong case for stoppping record selectors from being
  GlobalIds, and treating them much more like dict-funs.  I'm thinking
  about that.  Meanwhile, #2844 is ok now.
  

    M ./compiler/main/TidyPgm.lhs -2 +60
    M ./compiler/simplCore/SimplCore.lhs -49 +3

View patch online:
http://darcs.haskell.org/ghc/_darcs/patches/20081208173525-1287e-ece6d899a40b2f39c2f7ea968e126993607e0d11.gz

_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to