-- this module was automatically generated. do not edit!
-- edit util/mk_extensions_mod.hs instead
module Hint.Extension (
    Extension(..), supportedExtensions, availableExtensions, asExtension
) where

import qualified Hint.GHC as GHC

supportedExtensions :: [String]
supportedExtensions :: [String]
supportedExtensions = (FlagSpec Extension -> String) -> [FlagSpec Extension] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map FlagSpec Extension -> String
forall flag. FlagSpec flag -> String
f [FlagSpec Extension]
GHC.xFlags
    where
      f :: FlagSpec flag -> String
f = FlagSpec flag -> String
forall flag. FlagSpec flag -> String
GHC.flagSpecName

-- | List of the extensions known by the interpreter.
availableExtensions :: [Extension]
availableExtensions :: [Extension]
availableExtensions = (String -> Extension) -> [String] -> [Extension]
forall a b. (a -> b) -> [a] -> [b]
map String -> Extension
asExtension [String]
supportedExtensions

asExtension :: String -> Extension
asExtension :: String -> Extension
asExtension String
s = if String -> Bool
isKnown String
s
                  then String -> Extension
forall a. Read a => String -> a
read String
s
                  else let no_s :: String
no_s = String
"No" String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
s
                  in if String -> Bool
isKnown String
no_s then String -> Extension
forall a. Read a => String -> a
read String
no_s
                                     else String -> Extension
UnknownExtension String
s
  where isKnown :: String -> Bool
isKnown String
e = String
e String -> [String] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` (Extension -> String) -> [Extension] -> [String]
forall a b. (a -> b) -> [a] -> [b]
map Extension -> String
forall a. Show a => a -> String
show [Extension]
knownExtensions

-- | This represents language extensions beyond Haskell 98
--   that are supported by GHC (it was taken from
--   Cabal's @Language.Haskell.Extension@)
data Extension = OverlappingInstances
               | UndecidableInstances
               | IncoherentInstances
               | DoRec
               | RecursiveDo
               | ParallelListComp
               | MultiParamTypeClasses
               | MonomorphismRestriction
               | FunctionalDependencies
               | Rank2Types
               | RankNTypes
               | PolymorphicComponents
               | ExistentialQuantification
               | ScopedTypeVariables
               | PatternSignatures
               | ImplicitParams
               | FlexibleContexts
               | FlexibleInstances
               | EmptyDataDecls
               | CPP
               | KindSignatures
               | BangPatterns
               | TypeSynonymInstances
               | TemplateHaskell
               | ForeignFunctionInterface
               | Arrows
               | Generics
               | ImplicitPrelude
               | NamedFieldPuns
               | PatternGuards
               | GeneralizedNewtypeDeriving
               | ExtensibleRecords
               | RestrictedTypeSynonyms
               | HereDocuments
               | MagicHash
               | TypeFamilies
               | StandaloneDeriving
               | UnicodeSyntax
               | UnliftedFFITypes
               | InterruptibleFFI
               | CApiFFI
               | LiberalTypeSynonyms
               | TypeOperators
               | RecordWildCards
               | RecordPuns
               | DisambiguateRecordFields
               | TraditionalRecordSyntax
               | OverloadedStrings
               | GADTs
               | GADTSyntax
               | MonoPatBinds
               | RelaxedPolyRec
               | ExtendedDefaultRules
               | UnboxedTuples
               | DeriveDataTypeable
               | DeriveGeneric
               | DefaultSignatures
               | InstanceSigs
               | ConstrainedClassMethods
               | PackageImports
               | ImpredicativeTypes
               | NewQualifiedOperators
               | PostfixOperators
               | QuasiQuotes
               | TransformListComp
               | MonadComprehensions
               | ViewPatterns
               | XmlSyntax
               | RegularPatterns
               | TupleSections
               | GHCForeignImportPrim
               | NPlusKPatterns
               | DoAndIfThenElse
               | MultiWayIf
               | LambdaCase
               | RebindableSyntax
               | ExplicitForAll
               | DatatypeContexts
               | MonoLocalBinds
               | DeriveFunctor
               | DeriveTraversable
               | DeriveFoldable
               | NondecreasingIndentation
               | SafeImports
               | Safe
               | Trustworthy
               | Unsafe
               | ConstraintKinds
               | PolyKinds
               | DataKinds
               | ParallelArrays
               | RoleAnnotations
               | OverloadedLists
               | EmptyCase
               | AutoDeriveTypeable
               | NegativeLiterals
               | BinaryLiterals
               | NumDecimals
               | NullaryTypeClasses
               | ExplicitNamespaces
               | AllowAmbiguousTypes
               | JavaScriptFFI
               | PatternSynonyms
               | PartialTypeSignatures
               | NamedWildCards
               | DeriveAnyClass
               | DeriveLift
               | StaticPointers
               | StrictData
               | Strict
               | ApplicativeDo
               | DuplicateRecordFields
               | TypeApplications
               | TypeInType
               | UndecidableSuperClasses
               | MonadFailDesugaring
               | TemplateHaskellQuotes
               | OverloadedLabels
               | TypeFamilyDependencies
               | NoOverlappingInstances
               | NoUndecidableInstances
               | NoIncoherentInstances
               | NoDoRec
               | NoRecursiveDo
               | NoParallelListComp
               | NoMultiParamTypeClasses
               | NoMonomorphismRestriction
               | NoFunctionalDependencies
               | NoRank2Types
               | NoRankNTypes
               | NoPolymorphicComponents
               | NoExistentialQuantification
               | NoScopedTypeVariables
               | NoPatternSignatures
               | NoImplicitParams
               | NoFlexibleContexts
               | NoFlexibleInstances
               | NoEmptyDataDecls
               | NoCPP
               | NoKindSignatures
               | NoBangPatterns
               | NoTypeSynonymInstances
               | NoTemplateHaskell
               | NoForeignFunctionInterface
               | NoArrows
               | NoGenerics
               | NoImplicitPrelude
               | NoNamedFieldPuns
               | NoPatternGuards
               | NoGeneralizedNewtypeDeriving
               | NoExtensibleRecords
               | NoRestrictedTypeSynonyms
               | NoHereDocuments
               | NoMagicHash
               | NoTypeFamilies
               | NoStandaloneDeriving
               | NoUnicodeSyntax
               | NoUnliftedFFITypes
               | NoInterruptibleFFI
               | NoCApiFFI
               | NoLiberalTypeSynonyms
               | NoTypeOperators
               | NoRecordWildCards
               | NoRecordPuns
               | NoDisambiguateRecordFields
               | NoTraditionalRecordSyntax
               | NoOverloadedStrings
               | NoGADTs
               | NoGADTSyntax
               | NoMonoPatBinds
               | NoRelaxedPolyRec
               | NoExtendedDefaultRules
               | NoUnboxedTuples
               | NoDeriveDataTypeable
               | NoDeriveGeneric
               | NoDefaultSignatures
               | NoInstanceSigs
               | NoConstrainedClassMethods
               | NoPackageImports
               | NoImpredicativeTypes
               | NoNewQualifiedOperators
               | NoPostfixOperators
               | NoQuasiQuotes
               | NoTransformListComp
               | NoMonadComprehensions
               | NoViewPatterns
               | NoXmlSyntax
               | NoRegularPatterns
               | NoTupleSections
               | NoGHCForeignImportPrim
               | NoNPlusKPatterns
               | NoDoAndIfThenElse
               | NoMultiWayIf
               | NoLambdaCase
               | NoRebindableSyntax
               | NoExplicitForAll
               | NoDatatypeContexts
               | NoMonoLocalBinds
               | NoDeriveFunctor
               | NoDeriveTraversable
               | NoDeriveFoldable
               | NoNondecreasingIndentation
               | NoSafeImports
               | NoSafe
               | NoTrustworthy
               | NoUnsafe
               | NoConstraintKinds
               | NoPolyKinds
               | NoDataKinds
               | NoParallelArrays
               | NoRoleAnnotations
               | NoOverloadedLists
               | NoEmptyCase
               | NoAutoDeriveTypeable
               | NoNegativeLiterals
               | NoBinaryLiterals
               | NoNumDecimals
               | NoNullaryTypeClasses
               | NoExplicitNamespaces
               | NoAllowAmbiguousTypes
               | NoJavaScriptFFI
               | NoPatternSynonyms
               | NoPartialTypeSignatures
               | NoNamedWildCards
               | NoDeriveAnyClass
               | NoDeriveLift
               | NoStaticPointers
               | NoStrictData
               | NoStrict
               | NoApplicativeDo
               | NoDuplicateRecordFields
               | NoTypeApplications
               | NoTypeInType
               | NoUndecidableSuperClasses
               | NoMonadFailDesugaring
               | NoTemplateHaskellQuotes
               | NoOverloadedLabels
               | NoTypeFamilyDependencies
               | UnknownExtension String
        deriving (Extension -> Extension -> Bool
(Extension -> Extension -> Bool)
-> (Extension -> Extension -> Bool) -> Eq Extension
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Extension -> Extension -> Bool
$c/= :: Extension -> Extension -> Bool
== :: Extension -> Extension -> Bool
$c== :: Extension -> Extension -> Bool
Eq, Int -> Extension -> String -> String
[Extension] -> String -> String
Extension -> String
(Int -> Extension -> String -> String)
-> (Extension -> String)
-> ([Extension] -> String -> String)
-> Show Extension
forall a.
(Int -> a -> String -> String)
-> (a -> String) -> ([a] -> String -> String) -> Show a
showList :: [Extension] -> String -> String
$cshowList :: [Extension] -> String -> String
show :: Extension -> String
$cshow :: Extension -> String
showsPrec :: Int -> Extension -> String -> String
$cshowsPrec :: Int -> Extension -> String -> String
Show, ReadPrec [Extension]
ReadPrec Extension
Int -> ReadS Extension
ReadS [Extension]
(Int -> ReadS Extension)
-> ReadS [Extension]
-> ReadPrec Extension
-> ReadPrec [Extension]
-> Read Extension
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Extension]
$creadListPrec :: ReadPrec [Extension]
readPrec :: ReadPrec Extension
$creadPrec :: ReadPrec Extension
readList :: ReadS [Extension]
$creadList :: ReadS [Extension]
readsPrec :: Int -> ReadS Extension
$creadsPrec :: Int -> ReadS Extension
Read)

knownExtensions :: [Extension]
knownExtensions :: [Extension]
knownExtensions = [Extension
OverlappingInstances,
                   Extension
UndecidableInstances,
                   Extension
IncoherentInstances,
                   Extension
DoRec,
                   Extension
RecursiveDo,
                   Extension
ParallelListComp,
                   Extension
MultiParamTypeClasses,
                   Extension
MonomorphismRestriction,
                   Extension
FunctionalDependencies,
                   Extension
Rank2Types,
                   Extension
RankNTypes,
                   Extension
PolymorphicComponents,
                   Extension
ExistentialQuantification,
                   Extension
ScopedTypeVariables,
                   Extension
PatternSignatures,
                   Extension
ImplicitParams,
                   Extension
FlexibleContexts,
                   Extension
FlexibleInstances,
                   Extension
EmptyDataDecls,
                   Extension
CPP,
                   Extension
KindSignatures,
                   Extension
BangPatterns,
                   Extension
TypeSynonymInstances,
                   Extension
TemplateHaskell,
                   Extension
ForeignFunctionInterface,
                   Extension
Arrows,
                   Extension
Generics,
                   Extension
ImplicitPrelude,
                   Extension
NamedFieldPuns,
                   Extension
PatternGuards,
                   Extension
GeneralizedNewtypeDeriving,
                   Extension
ExtensibleRecords,
                   Extension
RestrictedTypeSynonyms,
                   Extension
HereDocuments,
                   Extension
MagicHash,
                   Extension
TypeFamilies,
                   Extension
StandaloneDeriving,
                   Extension
UnicodeSyntax,
                   Extension
UnliftedFFITypes,
                   Extension
InterruptibleFFI,
                   Extension
CApiFFI,
                   Extension
LiberalTypeSynonyms,
                   Extension
TypeOperators,
                   Extension
RecordWildCards,
                   Extension
RecordPuns,
                   Extension
DisambiguateRecordFields,
                   Extension
TraditionalRecordSyntax,
                   Extension
OverloadedStrings,
                   Extension
GADTs,
                   Extension
GADTSyntax,
                   Extension
MonoPatBinds,
                   Extension
RelaxedPolyRec,
                   Extension
ExtendedDefaultRules,
                   Extension
UnboxedTuples,
                   Extension
DeriveDataTypeable,
                   Extension
DeriveGeneric,
                   Extension
DefaultSignatures,
                   Extension
InstanceSigs,
                   Extension
ConstrainedClassMethods,
                   Extension
PackageImports,
                   Extension
ImpredicativeTypes,
                   Extension
NewQualifiedOperators,
                   Extension
PostfixOperators,
                   Extension
QuasiQuotes,
                   Extension
TransformListComp,
                   Extension
MonadComprehensions,
                   Extension
ViewPatterns,
                   Extension
XmlSyntax,
                   Extension
RegularPatterns,
                   Extension
TupleSections,
                   Extension
GHCForeignImportPrim,
                   Extension
NPlusKPatterns,
                   Extension
DoAndIfThenElse,
                   Extension
MultiWayIf,
                   Extension
LambdaCase,
                   Extension
RebindableSyntax,
                   Extension
ExplicitForAll,
                   Extension
DatatypeContexts,
                   Extension
MonoLocalBinds,
                   Extension
DeriveFunctor,
                   Extension
DeriveTraversable,
                   Extension
DeriveFoldable,
                   Extension
NondecreasingIndentation,
                   Extension
SafeImports,
                   Extension
Safe,
                   Extension
Trustworthy,
                   Extension
Unsafe,
                   Extension
ConstraintKinds,
                   Extension
PolyKinds,
                   Extension
DataKinds,
                   Extension
ParallelArrays,
                   Extension
RoleAnnotations,
                   Extension
OverloadedLists,
                   Extension
EmptyCase,
                   Extension
AutoDeriveTypeable,
                   Extension
NegativeLiterals,
                   Extension
BinaryLiterals,
                   Extension
NumDecimals,
                   Extension
NullaryTypeClasses,
                   Extension
ExplicitNamespaces,
                   Extension
AllowAmbiguousTypes,
                   Extension
JavaScriptFFI,
                   Extension
PatternSynonyms,
                   Extension
PartialTypeSignatures,
                   Extension
NamedWildCards,
                   Extension
DeriveAnyClass,
                   Extension
DeriveLift,
                   Extension
StaticPointers,
                   Extension
StrictData,
                   Extension
Strict,
                   Extension
ApplicativeDo,
                   Extension
DuplicateRecordFields,
                   Extension
TypeApplications,
                   Extension
TypeInType,
                   Extension
UndecidableSuperClasses,
                   Extension
MonadFailDesugaring,
                   Extension
TemplateHaskellQuotes,
                   Extension
OverloadedLabels,
                   Extension
TypeFamilyDependencies,
                   Extension
NoOverlappingInstances,
                   Extension
NoUndecidableInstances,
                   Extension
NoIncoherentInstances,
                   Extension
NoDoRec,
                   Extension
NoRecursiveDo,
                   Extension
NoParallelListComp,
                   Extension
NoMultiParamTypeClasses,
                   Extension
NoMonomorphismRestriction,
                   Extension
NoFunctionalDependencies,
                   Extension
NoRank2Types,
                   Extension
NoRankNTypes,
                   Extension
NoPolymorphicComponents,
                   Extension
NoExistentialQuantification,
                   Extension
NoScopedTypeVariables,
                   Extension
NoPatternSignatures,
                   Extension
NoImplicitParams,
                   Extension
NoFlexibleContexts,
                   Extension
NoFlexibleInstances,
                   Extension
NoEmptyDataDecls,
                   Extension
NoCPP,
                   Extension
NoKindSignatures,
                   Extension
NoBangPatterns,
                   Extension
NoTypeSynonymInstances,
                   Extension
NoTemplateHaskell,
                   Extension
NoForeignFunctionInterface,
                   Extension
NoArrows,
                   Extension
NoGenerics,
                   Extension
NoImplicitPrelude,
                   Extension
NoNamedFieldPuns,
                   Extension
NoPatternGuards,
                   Extension
NoGeneralizedNewtypeDeriving,
                   Extension
NoExtensibleRecords,
                   Extension
NoRestrictedTypeSynonyms,
                   Extension
NoHereDocuments,
                   Extension
NoMagicHash,
                   Extension
NoTypeFamilies,
                   Extension
NoStandaloneDeriving,
                   Extension
NoUnicodeSyntax,
                   Extension
NoUnliftedFFITypes,
                   Extension
NoInterruptibleFFI,
                   Extension
NoCApiFFI,
                   Extension
NoLiberalTypeSynonyms,
                   Extension
NoTypeOperators,
                   Extension
NoRecordWildCards,
                   Extension
NoRecordPuns,
                   Extension
NoDisambiguateRecordFields,
                   Extension
NoTraditionalRecordSyntax,
                   Extension
NoOverloadedStrings,
                   Extension
NoGADTs,
                   Extension
NoGADTSyntax,
                   Extension
NoMonoPatBinds,
                   Extension
NoRelaxedPolyRec,
                   Extension
NoExtendedDefaultRules,
                   Extension
NoUnboxedTuples,
                   Extension
NoDeriveDataTypeable,
                   Extension
NoDeriveGeneric,
                   Extension
NoDefaultSignatures,
                   Extension
NoInstanceSigs,
                   Extension
NoConstrainedClassMethods,
                   Extension
NoPackageImports,
                   Extension
NoImpredicativeTypes,
                   Extension
NoNewQualifiedOperators,
                   Extension
NoPostfixOperators,
                   Extension
NoQuasiQuotes,
                   Extension
NoTransformListComp,
                   Extension
NoMonadComprehensions,
                   Extension
NoViewPatterns,
                   Extension
NoXmlSyntax,
                   Extension
NoRegularPatterns,
                   Extension
NoTupleSections,
                   Extension
NoGHCForeignImportPrim,
                   Extension
NoNPlusKPatterns,
                   Extension
NoDoAndIfThenElse,
                   Extension
NoMultiWayIf,
                   Extension
NoLambdaCase,
                   Extension
NoRebindableSyntax,
                   Extension
NoExplicitForAll,
                   Extension
NoDatatypeContexts,
                   Extension
NoMonoLocalBinds,
                   Extension
NoDeriveFunctor,
                   Extension
NoDeriveTraversable,
                   Extension
NoDeriveFoldable,
                   Extension
NoNondecreasingIndentation,
                   Extension
NoSafeImports,
                   Extension
NoSafe,
                   Extension
NoTrustworthy,
                   Extension
NoUnsafe,
                   Extension
NoConstraintKinds,
                   Extension
NoPolyKinds,
                   Extension
NoDataKinds,
                   Extension
NoParallelArrays,
                   Extension
NoRoleAnnotations,
                   Extension
NoOverloadedLists,
                   Extension
NoEmptyCase,
                   Extension
NoAutoDeriveTypeable,
                   Extension
NoNegativeLiterals,
                   Extension
NoBinaryLiterals,
                   Extension
NoNumDecimals,
                   Extension
NoNullaryTypeClasses,
                   Extension
NoExplicitNamespaces,
                   Extension
NoAllowAmbiguousTypes,
                   Extension
NoJavaScriptFFI,
                   Extension
NoPatternSynonyms,
                   Extension
NoPartialTypeSignatures,
                   Extension
NoNamedWildCards,
                   Extension
NoDeriveAnyClass,
                   Extension
NoDeriveLift,
                   Extension
NoStaticPointers,
                   Extension
NoStrictData,
                   Extension
NoStrict,
                   Extension
NoApplicativeDo,
                   Extension
NoDuplicateRecordFields,
                   Extension
NoTypeApplications,
                   Extension
NoTypeInType,
                   Extension
NoUndecidableSuperClasses,
                   Extension
NoMonadFailDesugaring,
                   Extension
NoTemplateHaskellQuotes,
                   Extension
NoOverloadedLabels,
                   Extension
NoTypeFamilyDependencies
                   ]