> WOW!
> This is REALLY cool!
> I wonder what can be expressed using the RULES pragma. I am currently
> experimenting with an optimisation that generates fusion-rules using a
> "free theorem" [1]. These rules are on the form (a bit simplified):
> 
> forall f,g,g'.  f.g = g'.F  =>  f(g x) = g' x

Same story as in my reply to Conal: no, you can't do this
(yet at least).  I'm on the lookout for term-rewriting experts
who can help me do a better job.  

> Will this machinery replace other transformations in GHC. How 
> big impact
> will it have on the structure of the compiler.

No, not much. It's just a new feature of the 'simplifier'.
When it comes across "f applies to some arguments", it sees
if f has any transformation rules.  So at present the LHS
must be of the form
        f e1.. en

where f is a top-level function identifier.

> I hope you will release this soon. It's a very interesting addition.

It'll be a few weeks -- PLDI is looming.  But soon!

Simon

Reply via email to