<div dir="ltr">Great idea. I've worked on some code that uses SPECIALIZE pragmas with large type signatures, and it would become considerably more elegant if it could use type applications instead.<div><br></div><div>Vlad</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Nov 29, 2023 at 9:25 AM Adam Gundry <<a href="mailto:adam@well-typed.com">adam@well-typed.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear all,<br>
<br>
Richard and Simon propose to generalise SPECIALISE pragmas to allow <br>
expressions, not just type signatures:<br>
<br>
<a href="https://github.com/ghc-proposals/ghc-proposals/pull/493" rel="noreferrer" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/493</a><br>
<a href="https://github.com/goldfirere/ghc-proposals/blob/specialise/proposals/0000-specialise-expressions.rst" rel="noreferrer" target="_blank">https://github.com/goldfirere/ghc-proposals/blob/specialise/proposals/0000-specialise-expressions.rst</a><br>
<br>
This does not add anything fundamentally new, because such SPECIALISE <br>
pragmas can be translated using the existing RULES machinery, but it <br>
does make several idioms substantially more convenient:<br>
<br>
* Using type applications in a SPECIALISE pragma to avoid repetition<br>
<br>
* Manual call-pattern specialisation<br>
<br>
* Loop unrolling<br>
<br>
Thus I propose we accept this proposal.<br>
<br>
Cheers,<br>
<br>
Adam<br>
<br>
<br>
-- <br>
Adam Gundry, Haskell Consultant<br>
Well-Typed LLP, <a href="https://www.well-typed.com/" rel="noreferrer" target="_blank">https://www.well-typed.com/</a><br>
<br>
Registered in England & Wales, OC335890<br>
27 Old Gloucester Street, London WC1N 3AX, England<br>
_______________________________________________<br>
ghc-steering-committee mailing list<br>
<a href="mailto:ghc-steering-committee@haskell.org" target="_blank">ghc-steering-committee@haskell.org</a><br>
<a href="https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee" rel="noreferrer" target="_blank">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee</a><br>
</blockquote></div>