<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 22, 2013 at 6:13 PM, Simon Peyton-Jones <span dir="ltr">&lt;<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>&gt;</span> wrote:<br>


<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Luite, Edsko, Thomas, Nicolas<u></u><u></u></span></p>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></p>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">You have all variously proposed improvements to the GHC API and/or the plug-in mechanism.  I have been so swamped in the last few
 months that I have not had a chance to look carefully at your proposals, nor how they relate to each other.<u></u><u></u></span></p>
<p class=""><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> </span></p></div></div></blockquote><div><br></div><div>Edsko&#39;s source plugins are similar to Hooks, adding some functions to customize things through DynFlags. Unfortunately, adding things to DynFlags makes DynFlags depend on them, which severely limits extensibility of source plugins (already evidenced by Edsko&#39;s implementation using (forall m. MonadIO m =&gt; constraints for the plugins, instead of the actual RnM and Hsc monads in which they&#39;re always run)</div>


<div><br></div><div>Hooks adds an indirection to avoid this. I&#39;ve implemented Edsko&#39;s source plugins patch in terms of hooks in the latest update.</div><div><br></div><div>I think the RunPhaseHook already does much of what Thomas needs, perhaps he also needs something for hscParse / hscSimplify (both just a few lines change).<br>


</div><div><br></div><div><br></div><div>luite</div><div><br></div><div>The plugins from Edsko&#39;s patch as hooks:</div><div>RunQuasiQuoterHook: <a href="https://github.com/ghcjs/ghcjs-build/blob/f0147ed8b588151461557b0a8440581c4d36c9ec/refs/patches/ghc-ghcjs.patch#L1440">https://github.com/ghcjs/ghcjs-build/blob/f0147ed8b588151461557b0a8440581c4d36c9ec/refs/patches/ghc-ghcjs.patch#L1440</a></div>
<div>HscFrontendHook: <a href="https://github.com/ghcjs/ghcjs-build/blob/f0147ed8b588151461557b0a8440581c4d36c9ec/refs/patches/ghc-ghcjs.patch#L740">https://github.com/ghcjs/ghcjs-build/blob/f0147ed8b588151461557b0a8440581c4d36c9ec/refs/patches/ghc-ghcjs.patch#L740</a><br>
</div><div><br></div><div>How to use:</div><div><a href="https://gist.github.com/luite/6312097">https://gist.github.com/luite/6312097</a><br></div></div></div></div>