Arity and eta-expansion tuning
authorsimonpj@microsoft.com <unknown>
Wed, 21 Jun 2006 20:58:55 +0000 (20:58 +0000)
committersimonpj@microsoft.com <unknown>
Wed, 21 Jun 2006 20:58:55 +0000 (20:58 +0000)
commit182ce7e265699c9fd326f59d29767923100a2d16
tree96b1f99e804ee6e4d4a1d95c32b0cddbcb92181d
parentd4f8ccee287199f4ac34321f0fad64316950fc25
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.
compiler/basicTypes/Id.lhs
compiler/coreSyn/CoreUtils.lhs
compiler/simplCore/SimplEnv.lhs