<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I am sorry for not getting back sooner Joachim, <div class=""><br class=""></div><div class="">I agree, rewrite rules are cool and this is clearly a useful generalisation.</div><div class=""><br class=""></div><div class="">I vote in favour.</div><div class=""><br class=""></div><div class="">A small suggestion when crafting instructions to us -- do not under any circumstances, ever, give us the option of doing nothing! You will be taken up on it (which is a sad reflection os us, not you). :-)</div><div class=""><br class=""></div><div class="">Chris<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 2023-01-19, at 09:10, Simon Peyton Jones <<a href="mailto:simon.peytonjones@gmail.com" class="">simon.peytonjones@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-family:tahoma,sans-serif">Dear GHC Steering Committee</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Joachim wrote to us ten days ago recommending acceptance of #555.  No one has responded.</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Would you like to respond, please?  (I think this is an easy one.)<br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Thanks</div><div class="gmail_default" style="font-family:tahoma,sans-serif"><br class=""></div><div class="gmail_default" style="font-family:tahoma,sans-serif">Simon<br class=""></div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 10 Jan 2023 at 11:17, Joachim Breitner <<a href="mailto:mail@joachim-breitner.de" class="">mail@joachim-breitner.de</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear Committee,<br class="">
<br class="">
Jaro Reinders and Simon PJ propose to allow  Higher Order Patterns in Rewrite<br class="">
Rules.<br class="">
<br class="">
The idea, by way of an example,<br class="">
<br class="">
   {-# RULES forall f.  foo  (\y. f y + f y) = bar f #-}<br class="">
<br class="">
will now not only match "foo (\y. negate y + negate y)" (with f set to negate)<br class="">
but also "foo (\y. y*y + y*y)" (with f set to (\x. x*x)).<br class="">
<br class="">
Here "f y" is a higher-order pattern, which are restricted to a<br class="">
_pattern_ variable followed by a list of _local_ variable, indicating<br class="">
which variable the matched expression may depend on (previously, only<br class="">
closed expressions could be matched).<br class="">
<br class="">
An implementation is sitting ready at<br class="">
<a href="https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9343" rel="noreferrer" target="_blank" class="">https://gitlab.haskell.org/ghc/ghc/-/merge_requests/9343</a><br class="">
<br class="">
The design was carefully crafted to be backward-compatible and not<br class="">
introduce spurious etwa-expansion where there was non before.<br class="">
<br class="">
It is not guarded by a LANGUAGE pragma (but RULES themselves are not).<br class="">
Library authors who care about backward compat will have to deal with<br class="">
CPP pragmas.<br class="">
<br class="">
<br class="">
I’m a big fan of rewrite rules, and the proposal is straight forward<br class="">
and provides a feature that I'd maybe optimistically already assumed to<br class="">
be there already. Therefore, I’m recommending acceptance.<br class="">
<br class="">
If you disagree please speak up within two weeks, or speed up the<br class="">
process by indicating agreement earlier.<br class="">
<br class="">
Cheers,<br class="">
Joachim<br class="">
<br class="">
-- <br class="">
Joachim Breitner<br class="">
  <a href="mailto:mail@joachim-breitner.de" target="_blank" class="">mail@joachim-breitner.de</a><br class="">
  <a href="http://www.joachim-breitner.de/" rel="noreferrer" target="_blank" class="">http://www.joachim-breitner.de/</a><br class="">
<br class="">
_______________________________________________<br class="">
ghc-steering-committee mailing list<br class="">
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank" class="">ghc-steering-committee@haskell.org</a><br class="">
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank" class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br class="">
</blockquote></div>
_______________________________________________<br class="">ghc-steering-committee mailing list<br class=""><a href="mailto:ghc-steering-committee@haskell.org" class="">ghc-steering-committee@haskell.org</a><br class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee<br class=""></div></blockquote></div><br class=""></div></body></html>