I'm not sure exactly what you are asking here.
> For example, in   {rules  (map f).(map g) = map (f.g) }
>                   f xs = let  g = ...
>                               h = ...
>                               h1 = map g
>                               h2 = map h  
>                          in   h1 (h2 xs)
> the rule can do nothing with the source program. 

You are right -- h1 (h2 xs) doesn't match the rule.  But if the compiler
substitutes (map g} for h1, and (map h) for h2, then the rule will match.
If h1,h2 are (a) big and (b) used several times, then this substitution
won't happen.  That's important, because if (a) and (b) are true then
applying the rule would lose sharing, all the more so if (c) h1 or h2
is a redex.

Does that answer your question.

All this is useful info for what I should put in the documentation,
incidentally.
I'm not saying it's the only, or even the right, way of doing things.

Simon



Reply via email to