6.1.2. Overview of all language extensions¶
GHC supports these language extensions:
Extension | Description |
---|---|
Allow the user to write ambiguous types, and the type inference engine to infer them. | |
Allow do-notation statements to be desugared via | |
Allow arrow notation (e.g. | |
Allow bang pattern syntax. | |
Allow binary literal syntax. | |
Allow | |
Allow | |
Allow class methods to have non-empty contexts. | |
Allow constraints to be used as types of kind | |
Resolve C preprocessor directives. | |
Detect complete user-supplied kind signatures. | |
Allow use of data constructors in types. | |
Allow contexts on | |
Use GHC's deep subsumption checking. | |
Allow default signatures for typeclass methods. | |
Allow | |
Allow deriving for the | |
Allow deriving for the | |
Allow deriving for the | |
Allow deriving of | |
Allow deriving for the | |
Allow deriving for the | |
Allow use of instance deriving strategies. | |
Allow deriving instances | |
Automatically disambiguate some record field references. | |
Allow definition of record types with identically-named fields. | |
Allow | |
Allow definition of empty | |
Allow deriving instances of standard type classes for empty data types. | |
Allow existentially quantified type variables in types. | |
Allow explicit universal quantification. | |
Allow use of the keyword | |
Use GHCi's extended default rules in a normal module. | |
Allow numeric literal postfix syntax for unboxed integers. | |
Make record field selector functions visible in expressions. | |
Remove some restrictions on class contexts | |
Allow instance heads to mention arbitrary nested types. | |
Allow foreign function interface syntax. | |
Allow functional dependencies to be given on typeclass declarations. | |
Allow definition of generalised algebraic data types. | |
Allow generalised algebraic data type syntax. | |
Allow instances to be derived via | |
Use GHC’s set of default language extensions from 2021 | |
Use GHC’s set of default language extensions from 2024 | |
Allow | |
Use the Haskell 2010 language edition. | |
Use the Haskell 98 language edition. | |
Allow hexadecimal floating-point literal syntax. | |
Allow implicit parameter constraints. | |
Implicitly import | |
Allows the syntax | |
Allow impredicative types. | |
Allow definitions of instances that may result in incoherence. | |
Allow type signatures to be written for instance methods. | |
Allow | |
Allow kind signatures to be given for types. | |
Allow | |
Use whitespace to determine whether the minus sign stands for negation or subtraction. | |
Relax many of Haskell 98's rules on type synonym definitions. | |
Allow writing of linear arrow types. Implies | |
Enable punning for list, tuple and sum types. | |
Allow | |
Allow list comprehension syntax to be used at monads other than | |
Do not generalise types of local bindings. | |
Apply the Haskell 2010 monomorphism restriction. | |
Enable multiline string literals. | |
Enable multi-parameter type classes. | |
Allow multi-way | |
Enable | |
Allow record field punning syntax. | |
Allow named wildcards in types. | |
Allow negative numeric literal syntax. | |
Allow nested contexts to be at the same indentation level as its enclosing context. | |
Allow use of | |
Deprecated, does nothing. nullary type classes are now enabled using | |
Allow use of scientific notation syntax for integer literals. | |
Allow underscores in numeric literals. | |
Enable or-patterns. | |
Allow definition of overlapping instances. | |
Allow overloaded label syntax. | |
Desugar list syntax via the | |
Allow | |
Allow | |
Desugar string literals via | |
Allow package-qualified | |
Allow parallel list comprehension syntax. | |
Allow type signatures to contain wildcards. | |
Allow pattern guards syntax. | |
Allow definition of pattern synonyms. | |
Allow kind polymorphism. | |
Allow the use of postfix operators. | |
Allow qualified | |
Allow | |
Allow quasiquotation syntax. | |
Enable rank-2 types. | |
Allow types of rank greater than one. | |
Allow rebinding of builtin syntax. | |
Allow use of record wildcard syntax. | |
Allow recursive do (e.g. | |
Allow use of required type argument syntax in terms. | |
Allow role annotation syntax. | |
Enable the Safe Haskell Safe mode. | |
Lexically scope explicitly-introduced type variables. | |
Allow standalone instance deriving declarations. | |
Allow standalone kind signature declarations. | |
Treat | |
Allow | |
Make bindings in the current module strict by default. | |
Treat datatype fields as strict by default. | |
Allow Template Haskell's splice and quotation syntax. | |
Allow Template Haskell's quotation syntax. | |
Allow traditional record syntax (e.g. | |
Allow generalised list comprehension syntax. | |
Enable the Safe Haskell Trustworthy mode. | |
Allow use of tuple section synxtax. | |
Allow type abstraction syntax in patterns and type variable binders. | |
Allow type application syntax in terms and types. | |
Allow | |
Allow definition of type families. | |
Allow injectivity annotations on type families. | |
Deprecated. Enable kind polymorphism and datatype promotion. | |
Allow type constructors to be given operator names. | |
Allow type synonyms to be mentioned in instance heads. | |
Allow the use of unboxed sum syntax. | |
Allow the use of unboxed tuple syntax. | |
Allow definition of instances which may make solving undecidable. | |
Allow all superclass constraints, including those that may result in non-termination of the typechecker. | |
Enable unicode syntax. | |
Allow the definition of unlifted data types. | |
Allow the types of foreign imports to contain certain unlifted types. | |
Allow definition of unlifted newtypes. | |
Enable Safe Haskell Unsafe mode. | |
Allow view pattern syntax. |