Haskell language dialects and extensions
- data Language
- knownLanguages :: [Language]
- data Extension
- data KnownExtension
- = 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
- | NumDecimals
- | NullaryTypeClasses
- | ExplicitNamespaces
- | AllowAmbiguousTypes
- knownExtensions :: [KnownExtension]
- deprecatedExtensions :: [(Extension, Maybe Extension)]
This represents a Haskell language dialect.
Extensions are interpreted relative to one of these base
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
An unknown language, identified by its name.
Where applicable, references are given to an implementation's official documentation.
Enable a known extension
Disable a known extension
An unknown extension, identified by the name of its
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.
(deprecated) Allows recursive bindings in
Allows recursive bindings using
Provide syntax for writing list comprehensions which iterate
over several lists together, like the
Allow multiple parameters in a type class.
Enable the dreaded monomorphism restriction.
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.
Allow a universally-quantified type to occur on the left of a function arrow.
Allow data constructors to have polymorphic arguments. Unlike
Allow existentially-quantified data constructors.
Cause a type variable in a signature, which has an explicit
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
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 syntax for implicitly binding local names corresponding
to the field names of a record. Puns bind specific names, unlike
Enable a form of guard which matches a pattern and binds variables.
Allow a type declared with
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
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
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
Enable interruptible FFI.
Allow use of CAPI FFI calling convention (
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
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
Enable GADT syntax for declaring ordinary algebraic datatypes.
Make pattern bindings monomorphic.
Relax the requirements on mutually-recursive polymorphic functions.
Allow default instantiation of polymorphic types in more situations.
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.
Enables the use of tuple sections, e.g.
Allows GHC primops, written in C--, to be imported into a Haskell file.
Support for patterns of the form
Improve the layout rule when
Enable support for multi-way
Enable support lambda-
Makes much of the Haskell sugar be desugared into calls to the function with a particular name that is in scope.
Allow contexts to be put on datatypes, e.g. the
Enable non-decreasing indentation for
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
Enable kind polymorphism.
Enable datatype promotion.
Enable parallel arrays syntax (
Enable explicit role annotations, like in (
Enable overloading of list literals, arithmetic sequences and
list patterns using the
Enables case expressions that have no alternatives. Also applies to lambda-case expressions if they are enabled.
Triggers the generation of derived
Desugars negative literals directly (without using negate).
Enables 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.
Deprecated: KnownExtension is an instance of Enum and Bounded, use those instead.