<p dir="ltr">Would this be a feasible approach for harmonising the AST between GHC and TH too?</p>
<p dir="ltr">Alan</p>
<div class="gmail_quote">On 2 Sep 2015 09:27, "Michael Smith" <<a href="mailto:michael@diglumi.com">michael@diglumi.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">The package description for that is "The GHC compiler's view of the GHC package database format", and this doesn't really have to do with the package database format. Would it be okay to put this in there anyway?</p>
<br><div class="gmail_quote"><div dir="ltr">On Wed, Sep 2, 2015, 07:33 Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-GB" link="blue" vlink="purple">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">we already have such a shared library, I think: bin-package-db.  would that do?<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Simon<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> ghc-devs [mailto:<a href="mailto:ghc-devs-bounces@haskell.org" target="_blank">ghc-devs-bounces@haskell.org</a>]
<b>On Behalf Of </b>Michael Smith<br>
<b>Sent:</b> 02 September 2015 09:21<br>
<b>To:</b> Matthew Pickering<br>
<b>Cc:</b> GHC developers<br>
<b>Subject:</b> Re: Shared data type for extension flags<u></u><u></u></span></p>
</div>
</div></div></div></div><div lang="EN-GB" link="blue" vlink="purple"><div><div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
That sounds like a good approach. Are there other things that would go nicely<br>
in a shared package like this, in addition to the extension data type?<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
On Wed, Sep 2, 2015 at 1:00 AM, Matthew Pickering <<a href="mailto:matthewtpickering@gmail.com" target="_blank">matthewtpickering@gmail.com</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Surely the easiest way here (including for other tooling - ie<br>
haskell-src-exts) is to create a package which just provides this<br>
enumeration. GHC, cabal, th, haskell-src-exts and so on then all<br>
depend on this package rather than creating their own enumeration.<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<br>
On Wed, Sep 2, 2015 at 9:47 AM, Michael Smith <<a href="mailto:michael@diglumi.com" target="_blank">michael@diglumi.com</a>> wrote:<br>
> #10820 on Trac [1] and D1200 on Phabricator [2] discuss adding the<br>
> capababilty<br>
> to Template Haskell to detect which language extensions enabled.<br>
> Unfortunately,<br>
> since template-haskell can't depend on ghc (as ghc depends on<br>
> template-haskell),<br>
> it can't simply re-export the ExtensionFlag type from DynFlags to the user.<br>
><br>
> There is a second data type encoding the list of possible language<br>
> extensions in<br>
> the Cabal package, in Language.Haskell.Extension [3]. But template-haskell<br>
> doesn't already depend on Cabal, and doing so seems like it would cause<br>
> difficulties, as the two packages can be upgraded separately.<br>
><br>
> So adding this new feature to Template Haskell requires introducing a<br>
> *third*<br>
> data type for language extensions. It also requires enumerating this full<br>
> list<br>
> in two more places, to convert back and forth between the TH Extension data<br>
> type<br>
> and GHC's internal ExtensionFlag data type.<br>
><br>
> Is there another way here? Can there be one single shared data type for this<br>
> somehow?<br>
><br>
> [1] <a href="https://ghc.haskell.org/trac/ghc/ticket/10820" target="_blank">https://ghc.haskell.org/trac/ghc/ticket/10820</a><br>
> [2] <a href="https://phabricator.haskell.org/D1200" target="_blank">https://phabricator.haskell.org/D1200</a><br>
> [3]<br>
> <a href="https://hackage.haskell.org/package/Cabal-1.22.4.0/docs/Language-Haskell-Extension.html" target="_blank">
https://hackage.haskell.org/package/Cabal-1.22.4.0/docs/Language-Haskell-Extension.html</a><br>
><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
> _______________________________________________<br>
> ghc-devs mailing list<br>
> <a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a><br>
> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">
http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
><u></u><u></u></p>
</blockquote>
</div>
<p class="MsoNormal" style="margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<u></u> <u></u></p>
</div>
</div>
</div></div></div></blockquote></div>
<br>_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a><br>
<br></blockquote></div>