Another problem with typing RULES

Manuel M. T. Chakravarty chak@cse.unsw.edu.au
Tue, 06 Mar 2001 18:07:15 +1100


Simon Peyton-Jones <simonpj@microsoft.com> wrote,

> The trouble here is that the function you give is strict in acc1, acc2,
> but if GHC omitted the cases, it wouldn't be strict any more.
> 
> Maybe there's some context which means we know they are already
> evaluated?
> 
> Re dropping dead arguments, what you want is the 'static argument
> transformation', also known as lambda-dropping.  We used to have
> it, but it didn't make a lot of difference. We should probably
> reinstate it.   You could have a go if you like!  (After all, SpecConstr
> turned out pretty small, and that does something more complicated.)

It seems that with the new version of SpecConstr, the
problem is gone anyhow.  I guess, the case expressions get
pulled out of the loop.

I won't complain about an optimisation for free ;-)

Thanks,
Manuel