| Copyright | Isaac Jones 2003-2004 |
|---|---|
| License | BSD3 |
| Maintainer | libraries@haskell.org |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Language.Haskell.Extension
Description
Haskell language dialects and extensions
Synopsis
- data Language
- = Haskell98
- | Haskell2010
- | GHC2021
- | GHC2024
- | UnknownLanguage String
- knownLanguages :: [Language]
- classifyLanguage :: String -> Language
- data Extension
- data KnownExtension
- = OverlappingInstances
- | UndecidableInstances
- | IncoherentInstances
- | DoRec
- | RecursiveDo
- | ParallelListComp
- | MultiParamTypeClasses
- | MonomorphismRestriction
- | DeepSubsumption
- | FunctionalDependencies
- | Rank2Types
- | RankNTypes
- | PolymorphicComponents
- | ExistentialQuantification
- | ScopedTypeVariables
- | PatternSignatures
- | ImplicitParams
- | FlexibleContexts
- | FlexibleInstances
- | EmptyDataDecls
- | CPP
- | KindSignatures
- | BangPatterns
- | TypeSynonymInstances
- | TemplateHaskell
- | ForeignFunctionInterface
- | Arrows
- | Generics
- | ImplicitPrelude
- | NamedFieldPuns
- | PatternGuards
- | GeneralizedNewtypeDeriving
- | GeneralisedNewtypeDeriving
- | ExtensibleRecords
- | RestrictedTypeSynonyms
- | HereDocuments
- | MagicHash
- | TypeFamilies
- | StandaloneDeriving
- | UnicodeSyntax
- | UnliftedFFITypes
- | InterruptibleFFI
- | CApiFFI
- | LiberalTypeSynonyms
- | TypeOperators
- | RecordWildCards
- | RecordPuns
- | DisambiguateRecordFields
- | TraditionalRecordSyntax
- | OverloadedStrings
- | GADTs
- | GADTSyntax
- | MonoPatBinds
- | RelaxedPolyRec
- | ExtendedDefaultRules
- | NamedDefaults
- | 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
- | TypeData
- | ParallelArrays
- | RoleAnnotations
- | OverloadedLists
- | EmptyCase
- | AutoDeriveTypeable
- | NegativeLiterals
- | BinaryLiterals
- | NumDecimals
- | NullaryTypeClasses
- | ExplicitNamespaces
- | AllowAmbiguousTypes
- | JavaScriptFFI
- | PatternSynonyms
- | PartialTypeSignatures
- | NamedWildCards
- | DeriveLift
- | StaticPointers
- | StrictData
- | Strict
- | ApplicativeDo
- | DuplicateRecordFields
- | TypeApplications
- | TypeInType
- | UndecidableSuperClasses
- | MonadFailDesugaring
- | TemplateHaskellQuotes
- | OverloadedLabels
- | TypeFamilyDependencies
- | DerivingStrategies
- | DerivingVia
- | UnboxedSums
- | HexFloatLiterals
- | BlockArguments
- | NumericUnderscores
- | QuantifiedConstraints
- | StarIsType
- | EmptyDataDeriving
- | CUSKs
- | ImportQualifiedPost
- | StandaloneKindSignatures
- | UnliftedNewtypes
- | LexicalNegation
- | QualifiedDo
- | LinearTypes
- | RequiredTypeArguments
- | FieldSelectors
- | OverloadedRecordDot
- | OverloadedRecordUpdate
- | UnliftedDatatypes
- | ExtendedLiterals
- | AlternativeLayoutRule
- | AlternativeLayoutRuleTransitional
- | RelaxedLayout
- | TypeAbstractions
- | ListTuplePuns
- | MultilineStrings
- | OrPatterns
- deprecatedExtensions :: [(Extension, Maybe Extension)]
- classifyExtension :: String -> Extension
- knownExtensions :: [KnownExtension]
Documentation
This represents a Haskell language dialect.
Language Extension s are interpreted relative to one of these base
languages.
Constructors
The Haskell 98 language as defined by the Haskell 98 report. http://haskell.org/onlinereport/
The Haskell 2010 language as defined by the Haskell 2010 report. http://www.haskell.org/onlinereport/haskell2010
The GHC2021 collection of language extensions. https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0380-ghc2021.rst
The GHC2024 collection of language extensions. https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0613-ghc2024.rst
Instances
Instances details
Instance details
Defined in Language.Haskell.Extension
Methods
parsec :: CabalParsing m => m Language Source #
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
Methods
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Language -> c Language #
gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Language #
toConstr :: Language -> Constr #
dataTypeOf :: Language -> DataType #
dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Language) #
dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Language) #
gmapT :: (forall b. Data b => b -> b) -> Language -> Language #
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Language -> r #
gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Language -> r #
gmapQ :: (forall d. Data d => d -> u) -> Language -> [u] #
gmapQi :: Int -> (forall d. Data d => d -> u) -> Language -> u #
gmapM :: Monad m => (forall d. Data d => d -> m d) -> Language -> m Language #
gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Language -> m Language #
gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Language -> m Language #
Instance details
Defined in Language.Haskell.Extension
Associated Types
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
knownLanguages :: [Language] Source #
List of known (supported) languages for GHC, oldest first.
classifyLanguage :: String -> Language Source #
This represents language extensions beyond a base Language definition
(such as Haskell98 ) that are supported by some implementations, usually
in some special mode.
Where applicable, references are given to an implementation's official documentation.
Constructors
Instances
Instances details
Instance details
Defined in Language.Haskell.Extension
Methods
parsec :: CabalParsing m => m Extension Source #
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
Methods
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Extension -> c Extension #
gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Extension #
toConstr :: Extension -> Constr #
dataTypeOf :: Extension -> DataType #
dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Extension) #
dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Extension) #
gmapT :: (forall b. Data b => b -> b) -> Extension -> Extension #
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Extension -> r #
gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Extension -> r #
gmapQ :: (forall d. Data d => d -> u) -> Extension -> [u] #
gmapQi :: Int -> (forall d. Data d => d -> u) -> Extension -> u #
gmapM :: Monad m => (forall d. Data d => d -> m d) -> Extension -> m Extension #
gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Extension -> m Extension #
gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Extension -> m Extension #
Instance details
Defined in Language.Haskell.Extension
Associated Types
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
data KnownExtension Source #
Known Haskell language extensions, including deprecated and undocumented ones.
Check “Overview of all language extensions” in GHC User’s Guide for more information.
Constructors
Allow overlapping class instances, provided there is a unique most specific instance for each use.
Ignore structural rules guaranteeing the termination of class instance resolution. Termination is guaranteed by a fixed-depth recursion stack, and compilation may fail if this depth is exceeded.
Implies OverlappingInstances . Allow the implementation to
choose an instance even when it is possible that further
instantiation of types will lead to a more specific instance
being applicable.
(deprecated) Deprecated in favour of RecursiveDo .
Old description: Allow recursive bindings in do blocks, using
the rec keyword. See also RecursiveDo .
Allow recursive bindings in do blocks, using the rec
keyword, or mdo, a variant of do.
Provide syntax for writing list comprehensions which iterate
over several lists together, like the zipWith family of
functions.
Allow multiple parameters in a type class.
Enable the dreaded monomorphism restriction.
Enable deep subsumption, relaxing the simple subsumption rules, implicitly inserting eta-expansions when matching up function types with different quantification structures.
Allow a specification attached to a multi-parameter type class which indicates that some parameters are entirely determined by others. The implementation will check that this property holds for the declared instances, and will use this property to reduce ambiguity in instance resolution.
(deprecated) A synonym for RankNTypes .
Old description: Like RankNTypes but does not allow a
higher-rank type to itself appear on the left of a function
arrow.
Allow a universally-quantified type to occur on the left of a function arrow.
(deprecated) A synonym for RankNTypes .
Old description: Allow data constructors to have polymorphic
arguments. Unlike RankNTypes , does not allow this for ordinary
functions.
Allow existentially-quantified data constructors.
Cause a type variable in a signature, which has an explicit
forall quantifier, to scope over the definition of the
accompanying value declaration.
Deprecated, use ScopedTypeVariables instead.
Enable implicit function parameters with dynamic scope.
Relax some restrictions on the form of the context of a type signature.
Relax some restrictions on the form of the context of an instance declaration.
Allow data type declarations with no constructors.
Run the C preprocessor on Haskell source code.
Allow an explicit kind signature giving the kind of types over which a type variable ranges.
Enable a form of pattern which forces evaluation before an
attempted match, and a form of strict let/where binding.
Allow type synonyms in instance heads.
Enable Template Haskell, a system for compile-time metaprogramming.
Enable the Foreign Function Interface. In GHC, implements the standard Haskell 98 Foreign Function Interface Addendum, plus some GHC-specific extensions.
Enable arrow notation.
(deprecated) Enable generic type classes, with default instances defined in terms of the algebraic structure of a type.
Enable the implicit importing of the module Prelude. When disabled, when desugaring certain built-in syntax into ordinary identifiers, use whatever is in scope rather than the Prelude -- version.
Enable syntax for implicitly binding local names corresponding
to the field names of a record. Puns bind specific names, unlike
RecordWildCards .
Enable a form of guard which matches a pattern and binds variables.
Allow a type declared with newtype to use deriving for any
class with an instance for the underlying type.
Enable the "Trex" extensible records system.
Enable type synonyms which are transparent in some definitions and opaque elsewhere, as a way of implementing abstract datatypes.
Enable an alternate syntax for string literals, with string templating.
Allow the character # as a postfix modifier on identifiers.
Also enables literal syntax for unboxed values.
Allow data types and type synonyms which are indexed by types, i.e. ad-hoc polymorphism for types.
Allow a standalone declaration which invokes the type class
deriving mechanism.
Allow certain Unicode characters to stand for certain ASCII character sequences, e.g. keywords and punctuation.
Allow the use of unboxed types as foreign types, e.g. in
foreign import and foreign export.
Enable interruptible FFI.
Allow use of CAPI FFI calling convention (foreign import capi).
Defer validity checking of types until after expanding type synonyms, relaxing the constraints on how synonyms may be used.
Allow the name of a type constructor, type class, or type variable to be an infix operator.
Enable syntax for implicitly binding local names corresponding
to the field names of a record. A wildcard binds all unmentioned
names, unlike NamedFieldPuns .
Deprecated, use NamedFieldPuns instead.
Allow a record field name to be disambiguated by the type of the record it's in.
Enable traditional record syntax (as supported by Haskell 98)
Enable overloading of string literals using a type class, much like integer literals.
Enable generalized algebraic data types, in which type
variables may be instantiated on a per-constructor basis. Implies
GADTSyntax .
Enable GADT syntax for declaring ordinary algebraic datatypes.
Relax the requirements on mutually-recursive polymorphic functions.
Allow default instantiation of polymorphic types in more situations.
Allow default declarations to explicitly name the class and
be exported.
Enable unboxed tuples.
Enable support for default signatures.
Allow type signatures to be specified in instance declarations.
Allow a class method's type to place additional constraints on a class type variable.
Allow imports to be qualified by the package name the module is intended to be imported from, e.g.
import "network" Network.Socket
(deprecated) Allow a type variable to be instantiated at a polymorphic type.
(deprecated) Change the syntax for qualified infix operators.
Relax the interpretation of left operator sections to allow unary postfix operators.
Enable quasi-quotation, a mechanism for defining new concrete syntax for expressions and patterns.
Enable generalized list comprehensions, supporting operations such as sorting and grouping.
Enable monad comprehensions, which generalise the list comprehension syntax to work for any monad.
Enable view patterns, which match a value by applying a function and matching on the result.
Allow concrete XML syntax to be used in expressions and patterns, as per the Haskell Server Pages extension language: http://www.haskell.org/haskellwiki/HSP. The ideas behind it are discussed in the paper "Haskell Server Pages through Dynamic Loading" by Niklas Broberg, from Haskell Workshop '05.
Allow regular pattern matching over lists, as discussed in the paper "Regular Expression Patterns" by Niklas Broberg, Andreas Farre and Josef Svenningsson, from ICFP '04.
Enable the use of tuple sections, e.g. (, True) desugars into
x -> (x, True).
Allow GHC primops, written in C--, to be imported into a Haskell file.
Support for patterns of the form n + k, where k is an
integer literal.
Improve the layout rule when if expressions are used in a do
block.
Enable support for multi-way if-expressions.
Enable support lambda-case expressions.
Makes much of the Haskell sugar be desugared into calls to the function with a particular name that is in scope.
Make forall a keyword in types, which can be used to give the
generalisation explicitly.
Allow contexts to be put on datatypes, e.g. the Eq a in
data Eq a => Set a = NilSet | ConsSet a (Set a).
Local (let and where) bindings are monomorphic.
Enable deriving for the Functor class.
Enable deriving for the Traversable class.
Enable deriving for the Foldable class.
Enable non-decreasing indentation for do blocks.
Allow imports to be qualified with a safe keyword that requires the imported module be trusted as according to the Safe Haskell definition of trust.
import safe Network.Socket
Compile a module in the Safe, Safe Haskell mode -- a restricted form of the Haskell language to ensure type safety.
Compile a module in the Trustworthy, Safe Haskell mode -- no restrictions apply but the module is marked as trusted as long as the package the module resides in is trusted.
Compile a module in the Unsafe, Safe Haskell mode so that modules compiled using Safe, Safe Haskell mode can't import it.
Allow type classimplicit parameterequality constraints to be
used as types with the special kind constraint. Also generalise
the (ctxt => ty) syntax so that any type of kind constraint can
occur before the arrow.
Enable kind polymorphism.
Enable datatype promotion.
Enable type data declarations, defining constructors at the type level.
Enable parallel arrays syntax ([:, :]) for Data Parallel Haskell.
Enable explicit role annotations, like in (type role Foo representational representational).
Enable overloading of list literals, arithmetic sequences and
list patterns using the IsList type class.
Enable case expressions that have no alternatives. Also applies to lambda-case expressions if they are enabled.
(deprecated) Deprecated in favour of DeriveDataTypeable .
Old description: Triggers the generation of derived Typeable
instances for every datatype and type class declaration.
Desugars negative literals directly (without using negate).
Allow the use of binary integer literal syntax (e.g. 0b11001001 to denote 201).
Allow the use of floating literal syntax for all instances of Num , including Int and Integer .
Enable support for type classes with no type parameter.
Enable explicit namespaces in module import/export lists.
Allow the user to write ambiguous types, and the type inference engine to infer them.
Enable foreign import javascript.
Allow giving names to and abstracting over patterns.
Allow anonymous placeholders (underscore) inside type signatures. The type inference engine will generate a message describing the type inferred at the hole's location.
Allow named placeholders written with a leading underscore inside type signatures. Wildcards with the same name unify to the same type.
Enable deriving for any class.
Enable deriving for the Lift class.
Enable support for 'static pointers' (and the static
keyword) to refer to globally stable names, even across
different programs.
Switches data type declarations to be strict by default (as if
they had a bang using BangPatterns), and allow opt-in field
laziness using ~.
Switches all pattern bindings to be strict by default (as if
they had a bang using BangPatterns), ordinary patterns are
recovered using ~. Implies StrictData.
Allows do-notation for types that are as well
as Applicative . When enabled, desugaring Monad do notation tries to use
(*) and and fmap as far as possible.join
Allow records to use duplicated field labels for accessors.
Enable explicit type applications with the syntax id @Int.
Dissolve the distinction between types and kinds, allowing the compiler to reason about kind equality and therefore enabling GADTs to be promoted to the type-level.
Allow recursive (and therefore undecidable) super-class relationships.
A temporary extension to help library authors check if their code will compile with the new planned desugaring of fail.
A subset of TemplateHaskell including only quoting.
Allows use of the #label syntax.
Allow functional dependency annotations on type families to declare them as injective.
Allow multiple deriving clauses, each optionally qualified with a
strategy.
Enable deriving instances via types of the same runtime representation.
Implies DerivingStrategies .
Enable the use of unboxed sum syntax.
Allow use of hexadecimal literal notation for floating-point values.
Allow do blocks etc. in argument position.
Allow use of underscores in numeric literals.
Allow forall in constraints.
Have * refer to Type.
Liberalises deriving to provide instances for empty data types.
Enable detection of complete user-supplied kind signatures.
Allows the syntax import M qualified.
Allow the use of standalone kind signatures.
Enable unlifted newtypes.
Use whitespace to determine whether the minus sign stands for negation or subtraction.
Enable qualified do-notation desugaring.
Enable linear types.
Allow the use of visible forall in types of terms.
Enable the generation of selector functions corresponding to record fields.
Enable the use of record dot-accessor and updater syntax
Provides record . syntax in record updates, e.g. x {foo.bar = 1}.
Enable data types for which an unlifted or levity-polymorphic result kind is inferred.
Enable syntax for primitive numeric literals, e.g. 3#Int8
Undocumented parsing-related extensions introduced in GHC 7.0.
Undocumented parsing-related extensions introduced in GHC 7.0.
Undocumented parsing-related extensions introduced in GHC 7.2.
Allow the use of type abstraction syntax.
Allow the use of built-in syntax for list, tuple and sum type constructors rather than being exclusive to data constructors.
Support multiline strings.
Allow use of or-pattern syntax, condensing multiple patterns into a single one.
Instances
Instances details
Instance details
Defined in Language.Haskell.Extension
Methods
pretty :: KnownExtension -> Doc Source #
prettyVersioned :: CabalSpecVersion -> KnownExtension -> Doc Source #
Instance details
Defined in Language.Haskell.Extension
Methods
structure :: Proxy KnownExtension -> Structure Source #
structureHash' :: Tagged KnownExtension MD5
Instance details
Defined in Language.Haskell.Extension
Methods
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KnownExtension -> c KnownExtension #
gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c KnownExtension #
toConstr :: KnownExtension -> Constr #
dataTypeOf :: KnownExtension -> DataType #
dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c KnownExtension) #
dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c KnownExtension) #
gmapT :: (forall b. Data b => b -> b) -> KnownExtension -> KnownExtension #
gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KnownExtension -> r #
gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KnownExtension -> r #
gmapQ :: (forall d. Data d => d -> u) -> KnownExtension -> [u] #
gmapQi :: Int -> (forall d. Data d => d -> u) -> KnownExtension -> u #
gmapM :: Monad m => (forall d. Data d => d -> m d) -> KnownExtension -> m KnownExtension #
gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KnownExtension -> m KnownExtension #
gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KnownExtension -> m KnownExtension #
Instance details
Defined in Language.Haskell.Extension
Instance details
Defined in Language.Haskell.Extension
Methods
succ :: KnownExtension -> KnownExtension #
pred :: KnownExtension -> KnownExtension #
toEnum :: Int -> KnownExtension #
fromEnum :: KnownExtension -> Int #
enumFrom :: KnownExtension -> [KnownExtension] #
enumFromThen :: KnownExtension -> KnownExtension -> [KnownExtension] #
enumFromTo :: KnownExtension -> KnownExtension -> [KnownExtension] #
enumFromThenTo :: KnownExtension -> KnownExtension -> KnownExtension -> [KnownExtension] #
Instance details
Defined in Language.Haskell.Extension
Associated Types
Instance details
Defined in Language.Haskell.Extension
Methods
from :: KnownExtension -> Rep KnownExtension x #
to :: Rep KnownExtension x -> KnownExtension #
Instance details
Defined in Language.Haskell.Extension
Methods
readsPrec :: Int -> ReadS KnownExtension #
readList :: ReadS [KnownExtension] #
Instance details
Defined in Language.Haskell.Extension
Methods
showsPrec :: Int -> KnownExtension -> ShowS #
show :: KnownExtension -> String #
showList :: [KnownExtension] -> ShowS #
Instance details
Defined in Language.Haskell.Extension
Methods
put :: KnownExtension -> Put #
get :: Get KnownExtension #
putList :: [KnownExtension] -> Put #
Instance details
Defined in Language.Haskell.Extension
Methods
(==) :: KnownExtension -> KnownExtension -> Bool #
(/=) :: KnownExtension -> KnownExtension -> Bool #
Instance details
Defined in Language.Haskell.Extension
Methods
compare :: KnownExtension -> KnownExtension -> Ordering #
(<) :: KnownExtension -> KnownExtension -> Bool #
(<=) :: KnownExtension -> KnownExtension -> Bool #
(>) :: KnownExtension -> KnownExtension -> Bool #
(>=) :: KnownExtension -> KnownExtension -> Bool #
max :: KnownExtension -> KnownExtension -> KnownExtension #
min :: KnownExtension -> KnownExtension -> KnownExtension #
Instance details
Defined in Language.Haskell.Extension
deprecatedExtensions :: [(Extension, Maybe Extension)] Source #
Extensions that have been deprecated, possibly paired with another extension that replaces it.
classifyExtension :: String -> Extension Source #