#10820: Provide a way to detect what extensions are enabled via TH -------------------------------------+------------------------------------- Reporter: spinda | Owner: spinda Type: feature request | Status: new Priority: normal | Milestone: 8.0.1 Component: Template Haskell | Version: 7.10.2 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: th/T18020.hs Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1200 -------------------------------------+------------------------------------- Comment (by Ben Gamari <ben@…>): In [changeset:"c1e25536d67fba33ad6ddae5556115340d99000a/ghc" c1e2553/ghc]: {{{ #!CommitTicketReference repository="ghc" revision="c1e25536d67fba33ad6ddae5556115340d99000a" Expose enabled language extensions to TH This exposes `template-haskell` functions for querying the language extensions which are enabled when compiling a module, - an `isExtEnabled` function to check whether an extension is enabled - an `extsEnabled` function to obtain a full list of enabled extensions To avoid code duplication this adds a `GHC.LanguageExtensions` module to `ghc-boot` and moves `DynFlags.ExtensionFlag` into it. A happy consequence of this is that the ungainly `DynFlags` lost around 500 lines. Moreover, flags corresponding to language extensions are now clearly distinguished from other flags due to the `LangExt.*` prefix. Updates haddock submodule. This fixes #10820. Test Plan: validate Reviewers: austin, spinda, hvr, goldfire, alanz Reviewed By: goldfire Subscribers: mpickering, RyanGlScott, hvr, simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1200 GHC Trac Issues: #10820 }}} -- Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10820#comment:7> GHC <http://www.haskell.org/ghc/> The Glasgow Haskell Compiler