patch applied (ghc): Arity and eta-expansion tuning

Simon Peyton Jones simonpj at microsoft.com
Wed Jun 21 17:04:21 EDT 2006


Wed Jun 21 13:58:55 PDT 2006  simonpj at microsoft.com
  * Arity and eta-expansion tuning
  
  Roman found that 
      loop :: STRef s a -> Int -> ST s Int
      loop ref n = case n of
                     0 -> return n
                     n -> loop ref (n-1)
  wasn't eta-expanding nicely, despite the 'state hack'
  (see Id.isStateHackType).  The reason was two-fold:
  
    a) a bug in CoreUtils.arityType (the Var case)
  
    b) the arity of a recursive function was not being
  	exposed in its RHS (see commments with
  	SimplEnv.addLetIdInfo
  
  The commit fixes both.  
  

    M ./compiler/basicTypes/Id.lhs -1 +1
    M ./compiler/coreSyn/CoreUtils.lhs -7 +8
    M ./compiler/simplCore/SimplEnv.lhs -13 +26


More information about the Cvs-ghc mailing list