Expose enabled language extensions to TH

Authored by bgamari.

Description

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 Trac #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: Trac #10820