Shared data type for extension flags

Michael Smith michael at diglumi.com
Wed Sep 2 07:47:25 UTC 2015


#10820 on Trac [1] and D1200 on Phabricator [2] discuss adding the
capababilty
to Template Haskell to detect which language extensions enabled.
Unfortunately,
since template-haskell can't depend on ghc (as ghc depends on
template-haskell),
it can't simply re-export the ExtensionFlag type from DynFlags to the user.

There is a second data type encoding the list of possible language
extensions in
the Cabal package, in Language.Haskell.Extension [3]. But template-haskell
doesn't already depend on Cabal, and doing so seems like it would cause
difficulties, as the two packages can be upgraded separately.

So adding this new feature to Template Haskell requires introducing a
*third*
data type for language extensions. It also requires enumerating this full
list
in two more places, to convert back and forth between the TH Extension data
type
and GHC's internal ExtensionFlag data type.

Is there another way here? Can there be one single shared data type for this
somehow?

[1] https://ghc.haskell.org/trac/ghc/ticket/10820
[2] https://phabricator.haskell.org/D1200
[3]
https://hackage.haskell.org/package/Cabal-1.22.4.0/docs/Language-Haskell-Extension.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20150902/332e970b/attachment.html>


More information about the ghc-devs mailing list