gs :: [FlagSpec ExtensionFlag]
xFlags = [
  ( "CPP",                              Opt_Cpp, nop ),
  ( "PostfixOperators",                 Opt_PostfixOperators, nop ),
  ( "TupleSections",                    Opt_TupleSections, nop ),
  ( "PatternGuards",                    Opt_PatternGuards, nop ),
  ( "UnicodeSyntax",                    Opt_UnicodeSyntax, nop ),
  ( "MagicHash",                        Opt_MagicHash, nop ),
  ( "ExistentialQuantification",        Opt_ExistentialQuantification, nop ),
  ( "KindSignatures",                   Opt_KindSignatures, nop ),
  ( "RoleAnnotations",                  Opt_RoleAnnotations, nop ),
  ( "EmptyDataDecls",                   Opt_EmptyDataDecls, nop ),
  ( "ParallelListComp",                 Opt_ParallelListComp, nop ),
  ( "TransformListComp",                Opt_TransformListComp, nop ),
  ( "MonadComprehensions",              Opt_MonadComprehensions, nop),
  ( "ForeignFunctionInterface",         Opt_ForeignFunctionInterface, nop ),
  ( "UnliftedFFITypes",                 Opt_UnliftedFFITypes, nop ),
  ( "InterruptibleFFI",                 Opt_InterruptibleFFI, nop ),
  ( "CApiFFI",                          Opt_CApiFFI, nop ),
  ( "GHCForeignImportPrim",             Opt_GHCForeignImportPrim, nop ),
  ( "JavaScriptFFI",                    Opt_JavaScriptFFI, nop ),
  ( "LiberalTypeSynonyms",              Opt_LiberalTypeSynonyms, nop ),

  ( "PolymorphicComponents",            Opt_RankNTypes, nop),
  ( "Rank2Types",                       Opt_RankNTypes, nop),
  ( "RankNTypes",                       Opt_RankNTypes, nop ),

  ( "ImpredicativeTypes",               Opt_ImpredicativeTypes, nop),
  ( "TypeOperators",                    Opt_TypeOperators, nop ),
  ( "ExplicitNamespaces",               Opt_ExplicitNamespaces, nop ),
  ( "RecursiveDo",                      Opt_RecursiveDo, nop ),  -- Enables 'mdo' and 'rec'
  ( "DoRec",                            Opt_RecursiveDo,
     deprecatedForExtension "RecursiveDo" ),
  ( "Arrows",                           Opt_Arrows, nop ),
  ( "ParallelArrays",                   Opt_ParallelArrays, nop ),
  ( "TemplateHaskell",                  Opt_TemplateHaskell, checkTemplateHaskellOk ),
  ( "QuasiQuotes",                      Opt_QuasiQuotes, nop ),
  ( "ImplicitPrelude",                  Opt_ImplicitPrelude, nop ),
  ( "RecordWildCards",                  Opt_RecordWildCards, nop ),
  ( "NamedFieldPuns",                   Opt_RecordPuns, nop ),
  ( "RecordPuns",                       Opt_RecordPuns,
    deprecatedForExtension "NamedFieldPuns" ),
  ( "DisambiguateRecordFields",         Opt_DisambiguateRecordFields, nop ),
  ( "OverloadedStrings",                Opt_OverloadedStrings, nop ),
  ( "NumDecimals",                      Opt_NumDecimals, nop),
  ( "OverloadedLists",                  Opt_OverloadedLists, nop),
  ( "GADTs",                            Opt_GADTs, nop ),
  ( "GADTSyntax",                       Opt_GADTSyntax, nop ),
  ( "ViewPatterns",                     Opt_ViewPatterns, nop ),
  ( "TypeFamilies",                     Opt_TypeFamilies, nop ),
  ( "BangPatterns",                     Opt_BangPatterns, nop ),
  ( "MonomorphismRestriction",          Opt_MonomorphismRestriction, nop ),
  ( "NPlusKPatterns",                   Opt_NPlusKPatterns, nop ),
  ( "DoAndIfThenElse",                  Opt_DoAndIfThenElse, nop ),
  ( "RebindableSyntax",                 Opt_RebindableSyntax, nop ),
  ( "ConstraintKinds",                  Opt_ConstraintKinds, nop ),
  ( "PolyKinds",                        Opt_PolyKinds, nop ),
  ( "DataKinds",                        Opt_DataKinds, nop ),
  ( "InstanceSigs",                     Opt_InstanceSigs, nop ),
  ( "MonoPatBinds",                     Opt_MonoPatBinds,
    \ turn_on -> when turn_on $ deprecate "Experimental feature now removed; has no effect" ),
  ( "ExplicitForAll",                   Opt_ExplicitForAll, nop ),
  ( "AlternativeLayoutRule",            Opt_AlternativeLayoutRule, nop ),
  ( "AlternativeLayoutRuleTransitional",Opt_AlternativeLayoutRuleTransitional, nop ),
  ( "DatatypeContexts",                 Opt_DatatypeContexts,
    \ turn_on -> when turn_on $ deprecate "It was widely considered a misfeature, and has been removed from the Haskell language." ),
  ( "NondecreasingIndentation",         Opt_NondecreasingIndentation, nop ),
  ( "RelaxedLayout",                    Opt_RelaxedLayout, nop ),
  ( "TraditionalRecordSyntax",          Opt_TraditionalRecordSyntax, nop ),
  ( "LambdaCase",                       Opt_LambdaCase, nop ),
  ( "MultiWayIf",                       Opt_MultiWayIf, nop ),
  ( "MonoLocalBinds",                   Opt_MonoLocalBinds, nop ),
  ( "RelaxedPolyRec",                   Opt_RelaxedPolyRec,
    \ turn_on -> unless turn_on
               $ deprecate "You can't turn off RelaxedPolyRec any more" ),
  ( "ExtendedDefaultRules",             Opt_ExtendedDefaultRules, nop ),
  ( "ImplicitParams",                   Opt_ImplicitParams, nop ),
  ( "ScopedTypeVariables",              Opt_ScopedTypeVariables, nop ),
  ( "AllowAmbiguousTypes",              Opt_AllowAmbiguousTypes, nop),

  ( "PatternSignatures",                Opt_ScopedTypeVariables,
    deprecatedForExtension "ScopedTypeVariables" ),

  ( "UnboxedTuples",                    Opt_UnboxedTuples, nop ),
  ( "StandaloneDeriving",               Opt_StandaloneDeriving, nop ),
  ( "DeriveDataTypeable",               Opt_DeriveDataTypeable, nop ),
  ( "AutoDeriveTypeable",               Opt_AutoDeriveTypeable, nop ),
  ( "DeriveFunctor",                    Opt_DeriveFunctor, nop ),
  ( "DeriveTraversable",                Opt_DeriveTraversable, nop ),
  ( "DeriveFoldable",                   Opt_DeriveFoldable, nop ),
  ( "DeriveGeneric",                    Opt_DeriveGeneric, nop ),
  ( "DefaultSignatures",                Opt_DefaultSignatures, nop ),
  ( "TypeSynonymInstances",             Opt_TypeSynonymInstances, nop ),
  ( "FlexibleContexts",                 Opt_FlexibleContexts, nop ),
  ( "FlexibleInstances",                Opt_FlexibleInstances, nop ),
  ( "ConstrainedClassMethods",          Opt_ConstrainedClassMethods, nop ),
  ( "MultiParamTypeClasses",            Opt_MultiParamTypeClasses, nop ),
  ( "NullaryTypeClasses",               Opt_NullaryTypeClasses, nop ),
  ( "FunctionalDependencies",           Opt_FunctionalDependencies, nop ),
  ( "GeneralizedNewtypeDeriving",       Opt_GeneralizedNewtypeDeriving, setGenDeriving ),
  ( "OverlappingInstances",             Opt_OverlappingInstances, nop ),
  ( "UndecidableInstances",             Opt_UndecidableInstances, nop ),
  ( "IncoherentInstances",              Opt_IncoherentInstances, nop ),
  ( "PackageImports",                   Opt_PackageImports, nop ),
  ( "TypeHoles",                        Opt_TypeHoles, nop ),
  ( "NegativeLiterals",                 Opt_NegativeLiterals, nop ),
  ( "EmptyCase",                        Opt_EmptyCase, nop )
  ]

de
xFlags :: [FlagSpec ExtensionFlag]
xFlags = [
  ( "CPP",                              Opt_Cpp, nop ),
  ( "PostfixOperators",                 Opt_PostfixOperators, nop ),
  ( "TupleSections",                    Opt_TupleSections, nop ),
  ( "PatternGuards",                    Opt_PatternGuards, nop ),
  ( "UnicodeSyntax",                    Opt_UnicodeSyntax, nop ),
  ( "MagicHash",                        Opt_MagicHash, nop ),
  ( "ExistentialQuantification",        Opt_ExistentialQuantification, nop ),
  ( "KindSignatures",                   Opt_KindSignatures, nop ),
  ( "RoleAnnotations",                  Opt_RoleAnnotations, nop ),
  ( "EmptyDataDecls",                   Opt_EmptyDataDecls, nop ),
  ( "ParallelListComp",                 Opt_ParallelListComp, nop ),
  ( "TransformListComp",                Opt_TransformListComp, nop ),
  ( "MonadComprehensions",              Opt_MonadComprehensions, nop),
  ( "ForeignFunctionInterface",         Opt_ForeignFunctionInterface, nop ),
  ( "UnliftedFFITypes",                 Opt_UnliftedFFITypes, nop ),
  ( "InterruptibleFFI",                 Opt_InterruptibleFFI, nop ),
  ( "CApiFFI",                          Opt_CApiFFI, nop ),
  ( "GHCForeignImportPrim",             Opt_GHCForeignImportPrim, nop ),
  ( "JavaScriptFFI",                    Opt_JavaScriptFFI, nop ),
  ( "LiberalTypeSynonyms",              Opt_LiberalTypeSynonyms, nop ),

  ( "PolymorphicComponents",            Opt_RankNTypes, nop),
  ( "Rank2Types",                       Opt_RankNTypes, nop),
  ( "RankNTypes",                       Opt_RankNTypes, nop ),

  ( "ImpredicativeTypes",               Opt_ImpredicativeTypes, nop),
  ( "TypeOperators",                    Opt_TypeOperators, nop ),
  ( "ExplicitNamespaces",               Opt_ExplicitNamespaces, nop ),
  ( "RecursiveDo",                      Opt_RecursiveDo, nop ),  -- Enables 'mdo' and 'rec'
  ( "DoRec",                            Opt_RecursiveDo,
     deprecatedForExtension "RecursiveDo" ),
  ( "Arrows",                           Opt_Arrows, nop ),
  ( "ParallelArrays",                   Opt_ParallelArrays, nop ),
  ( "TemplateHaskell",                  Opt_TemplateHaskell, checkTemplateHaskellOk ),
  ( "QuasiQuotes",                      Opt_QuasiQuotes, nop ),
  ( "ImplicitPrelude",                  Opt_ImplicitPrelude, nop ),
  ( "RecordWildCards",                  Opt_RecordWildCards, nop ),
  ( "NamedFieldPuns",                   Opt_RecordPuns, nop ),
  ( "RecordPuns",                       Opt_RecordPuns,
    deprecatedForExtension "NamedFieldPuns" ),
  ( "DisambiguateRecordFields",         Opt_DisambiguateRecordFields, nop ),
  ( "OverloadedStrings",                Opt_OverloadedStrings, nop ),
  ( "NumDecimals",                      Opt_NumDecimals, nop),
  ( "OverloadedLists",                  Opt_OverloadedLists, nop),
  ( "GADTs",                            Opt_GADTs, nop ),
  ( "GADTSyntax",                       Opt_GADTSyntax, nop ),
  ( "ViewPatterns",                     Opt_ViewPatterns, nop ),
  ( "TypeFamilies",                     Opt_TypeFamilies, nop ),
  ( "BangPatterns",                     Opt_BangPatterns, nop ),
  ( "MonomorphismRestriction",          Opt_MonomorphismRestriction, nop ),
  ( "NPlusKPatterns",                   Opt_NPlusKPatterns, nop ),
  ( "DoAndIfThenElse",                  Opt_DoAndIfThenElse, nop ),
  ( "RebindableSyntax",                 Opt_RebindableSyntax, nop ),
  ( "ConstraintKinds",                  Opt_ConstraintKinds, nop ),
  ( "PolyKinds",                        Opt_PolyKinds, nop ),
  ( "DataKinds",                        Opt_DataKinds, nop ),
  ( "InstanceSigs",                     Opt_InstanceSigs, nop ),
  ( "MonoPatBinds",                     Opt_MonoPatBinds,
    \ turn_on -> when turn_on $ deprecate "Experimental feature now removed; has no effect" ),
  ( "ExplicitForAll",                   Opt_ExplicitForAll, nop ),
  ( "AlternativeLayoutRule",            Opt_AlternativeLayoutRule, nop ),
  ( "AlternativeLayoutRuleTransitional",Opt_AlternativeLayoutRuleTransitional, nop ),
  ( "DatatypeContexts",                 Opt_DatatypeContexts,
    \ turn_on -> when turn_on $ deprecate "It was widely considered a misfeature, and has been removed from the Haskell language." ),
  ( "NondecreasingIndentation",         Opt_NondecreasingIndentation, nop ),
  ( "RelaxedLayout",                    Opt_RelaxedLayout, nop ),
  ( "TraditionalRecordSyntax",          Opt_TraditionalRecordSyntax, nop ),
  ( "LambdaCase",                       Opt_LambdaCase, nop ),
  ( "MultiWayIf",                       Opt_MultiWayIf, nop ),
  ( "MonoLocalBinds",                   Opt_MonoLocalBinds, nop ),
  ( "RelaxedPolyRec",                   Opt_RelaxedPolyRec,
    \ turn_on -> unless turn_on
               $ deprecate "You can't turn off RelaxedPolyRec any more" ),
  ( "ExtendedDefaultRules",             Opt_ExtendedDefaultRules, nop ),
  ( "ImplicitParams",                   Opt_ImplicitParams, nop ),
  ( "ScopedTypeVariables",              Opt_ScopedTypeVariables, nop ),
  ( "AllowAmbiguousTypes",              Opt_AllowAmbiguousTypes, nop),

  ( "PatternSignatures",                Opt_ScopedTypeVariables,
    deprecatedForExtension "ScopedTypeVariables" ),

  ( "UnboxedTuples",                    Opt_UnboxedTuples, nop ),
  ( "StandaloneDeriving",               Opt_StandaloneDeriving, nop ),
  ( "DeriveDataTypeable",               Opt_DeriveDataTypeable, nop ),
  ( "AutoDeriveTypeable",               Opt_AutoDeriveTypeable, nop ),
  ( "DeriveFunctor",                    Opt_DeriveFunctor, nop ),
  ( "DeriveTraversable",                Opt_DeriveTraversable, nop ),
  ( "DeriveFoldable",                   Opt_DeriveFoldable, nop ),
  ( "DeriveGeneric",                    Opt_DeriveGeneric, nop ),
  ( "DefaultSignatures",                Opt_DefaultSignatures, nop ),
  ( "TypeSynonymInstances",             Opt_TypeSynonymInstances, nop ),
  ( "FlexibleContexts",                 Opt_FlexibleContexts, nop ),
  ( "FlexibleInstances",                Opt_FlexibleInstances, nop ),
  ( "ConstrainedClassMethods",          Opt_ConstrainedClassMethods, nop ),
  ( "MultiParamTypeClasses",            Opt_MultiParamTypeClasses, nop ),
  ( "NullaryTypeClasses",               Opt_NullaryTypeClasses, nop ),
  ( "FunctionalDependencies",           Opt_FunctionalDependencies, nop ),
  ( "GeneralizedNewtypeDeriving",       Opt_GeneralizedNewtypeDeriving, setGenDeriving ),
  ( "OverlappingInstances",             Opt_OverlappingInstances, nop ),
  ( "UndecidableInstances",             Opt_UndecidableInstances, nop ),
  ( "IncoherentInstances",              Opt_IncoherentInstances, nop ),
  ( "PackageImports",                   Opt_PackageImports, nop ),
  ( "TypeHoles",                        Opt_TypeHoles, nop ),
  ( "NegativeLiterals",                 Opt_NegativeLiterals, nop ),
  ( "EmptyCase",                        Opt_EmptyCase, nop )
  ]
xFlags = [
  ( "CPP",                              Opt_Cpp, nop ),
  ( "PostfixOperators",                 Opt_PostfixOperators, nop ),
  ( "TupleSections",                    Opt_TupleSections, nop ),
  ( "PatternGuards",                    Opt_PatternGuards, nop ),
  ( "UnicodeSyntax",                    Opt_UnicodeSyntax, nop ),
  ( "MagicHash",                        Opt_MagicHash, nop ),
  ( "ExistentialQuantification",        Opt_ExistentialQuantification, nop ),
  ( "KindSignatures",                   Opt_KindSignatures, nop ),
  ( "RoleAnnotations",                  Opt_RoleAnnotations, nop ),
  ( "EmptyDataDecls",                   Opt_EmptyDataDecls, nop ),
  ( "ParallelListComp",                 Opt_ParallelListComp, nop ),
  ( "TransformListComp",                Opt_TransformListComp, nop ),
  ( "MonadComprehensions",              Opt_MonadComprehensions, nop),
  ( "ForeignFunctionInterface",         Opt_ForeignFunctionInterface, nop ),
  ( "UnliftedFFITypes",                 Opt_UnliftedFFITypes, nop ),
  ( "InterruptibleFFI",                 Opt_InterruptibleFFI, nop ),
  ( "CApiFFI",                          Opt_CApiFFI, nop ),
  ( "GHCForeignImportPrim",             Opt_GHCForeignImportPrim, nop ),
  ( "JavaScriptFFI",                    Opt_JavaScriptFFI, nop ),
  ( "LiberalTypeSynonyms",              Opt_LiberalTypeSynonyms, nop ),

  ( "PolymorphicComponents",            Opt_RankNTypes, nop),
  ( "Rank2Types",                       Opt_RankNTypes, nop),
  ( "RankNTypes",                       Opt_RankNTypes, nop ),

  ( "ImpredicativeTypes",               Opt_ImpredicativeTypes, nop),
  ( "TypeOperators",                    Opt_TypeOperators, nop ),
  ( "ExplicitNamespaces",               Opt_ExplicitNamespaces, nop ),
  ( "RecursiveDo",                      Opt_RecursiveDo, nop ),  -- Enables 'mdo' and 'rec'
  ( "DoRec",                            Opt_RecursiveDo,
     deprecatedForExtension "RecursiveDo" ),
  ( "Arrows",                           Opt_Arrows, nop ),
  ( "ParallelArrays",                   Opt_ParallelArrays, nop ),
  ( "TemplateHaskell",                  Opt_TemplateHaskell, checkTemplateHaskellOk ),
  ( "QuasiQuotes",                      Opt_QuasiQuotes, nop ),
  ( "ImplicitPrelude",                  Opt_ImplicitPrelude, nop ),
  ( "RecordWildCards",                  Opt_RecordWildCards, nop ),
  ( "NamedFieldPuns",                   Opt_RecordPuns, nop ),
  ( "RecordPuns",                       Opt_RecordPuns,
    deprecatedForExtension "NamedFieldPuns" ),
  ( "DisambiguateRecordFields",         Opt_DisambiguateRecordFields, nop ),
  ( "OverloadedStrings",                Opt_OverloadedStrings, nop ),
  ( "NumDecimals",                      Opt_NumDecimals, nop),
  ( "OverloadedLists",                  Opt_OverloadedLists, nop),
  ( "GADTs",                            Opt_GADTs, nop ),
  ( "GADTSyntax",                       Opt_GADTSyntax, nop ),
  ( "ViewPatterns",                     Opt_ViewPatterns, nop ),
  ( "TypeFamilies",                     Opt_TypeFamilies, nop ),
  ( "BangPatterns",                     Opt_BangPatterns, nop ),
  ( "MonomorphismRestriction",          Opt_MonomorphismRestriction, nop ),
  ( "NPlusKPatterns",                   Opt_NPlusKPatterns, nop ),
  ( "DoAndIfThenElse",                  Opt_DoAndIfThenElse, nop ),
  ( "RebindableSyntax",                 Opt_RebindableSyntax, nop ),
  ( "ConstraintKinds",                  Opt_ConstraintKinds, nop ),
  ( "PolyKinds",                        Opt_PolyKinds, nop ),
  ( "DataKinds",                        Opt_DataKinds, nop ),
  ( "InstanceSigs",                     Opt_InstanceSigs, nop ),
  ( "MonoPatBinds",                     Opt_MonoPatBinds,
    \ turn_on -> when turn_on $ deprecate "Experimental feature now removed; has no effect" ),
  ( "ExplicitForAll",                   Opt_ExplicitForAll, nop ),
  ( "AlternativeLayoutRule",            Opt_AlternativeLayoutRule, nop ),
  ( "AlternativeLayoutRuleTransitional",Opt_AlternativeLayoutRuleTransitional, nop ),
  ( "DatatypeContexts",                 Opt_DatatypeContexts,
    \ turn_on -> when turn_on $ deprecate "It was widely considered a misfeature, and has been removed from the Haskell language." ),
  ( "NondecreasingIndentation",         Opt_NondecreasingIndentation, nop ),
  ( "RelaxedLayout",                    Opt_RelaxedLayout, nop ),
  ( "TraditionalRecordSyntax",          Opt_TraditionalRecordSyntax, nop ),
  ( "LambdaCase",                       Opt_LambdaCase, nop ),
  ( "MultiWayIf",                       Opt_MultiWayIf, nop ),
  ( "MonoLocalBinds",                   Opt_MonoLocalBinds, nop ),
  ( "RelaxedPolyRec",                   Opt_RelaxedPolyRec,
    \ turn_on -> unless turn_on
               $ deprecate "You can't turn off RelaxedPolyRec any more" ),
  ( "ExtendedDefaultRules",             Opt_ExtendedDefaultRules, nop ),
  ( "ImplicitParams",                   Opt_ImplicitParams, nop ),
  ( "ScopedTypeVariables",              Opt_ScopedTypeVariables, nop ),
  ( "AllowAmbiguousTypes",              Opt_AllowAmbiguousTypes, nop),

  ( "PatternSignatures",                Opt_ScopedTypeVariables,
    deprecatedForExtension "ScopedTypeVariables" ),

  ( "UnboxedTuples",                    Opt_UnboxedTuples, nop ),
  ( "StandaloneDeriving",               Opt_StandaloneDeriving, nop ),
  ( "DeriveDataTypeable",               Opt_DeriveDataTypeable, nop ),
  ( "AutoDeriveTypeable",               Opt_AutoDeriveTypeable, nop ),
  ( "DeriveFunctor",                    Opt_DeriveFunctor, nop ),
  ( "DeriveTraversable",                Opt_DeriveTraversable, nop ),
  ( "DeriveFoldable",                   Opt_DeriveFoldable, nop ),
  ( "DeriveGeneric",                    Opt_DeriveGeneric, nop ),
  ( "DefaultSignatures",                Opt_DefaultSignatures, nop ),
  ( "TypeSynonymInstances",             Opt_TypeSynonymInstances, nop ),
  ( "FlexibleContexts",                 Opt_FlexibleContexts, nop ),
  ( "FlexibleInstances",                Opt_FlexibleInstances, nop ),
  ( "ConstrainedClassMethods",          Opt_ConstrainedClassMethods, nop ),
  ( "MultiParamTypeClasses",            Opt_MultiParamTypeClasses, nop ),
  ( "NullaryTypeClasses",               Opt_NullaryTypeClasses, nop ),
  ( "FunctionalDependencies",           Opt_FunctionalDependencies, nop ),
  ( "GeneralizedNewtypeDeriving",       Opt_GeneralizedNewtypeDeriving, setGenDeriving ),
  ( "OverlappingInstances",             Opt_OverlappingInstances, nop ),
  ( "UndecidableInstances",             Opt_UndecidableInstances, nop ),
  ( "IncoherentInstances",              Opt_IncoherentInstances, nop ),
  ( "PackageImports",                   Opt_PackageImports, nop ),
  ( "TypeHoles",                        Opt_TypeHoles, nop ),
  ( "NegativeLiterals",                 Opt_NegativeLiterals, nop ),
  ( "EmptyCase",                        Opt_EmptyCase, nop )
  ]