Difference between revisions of "Language extensions"

From HaskellWiki
Jump to: navigation, search
(List of language extensions by name: fix tuple sections link)
(List of language extensions by name)
 
(One intermediate revision by one other user not shown)
Line 39: Line 39:
 
* [[Rank-N types|RankNTypes]]
 
* [[Rank-N types|RankNTypes]]
 
* [[Scoped type variables|ScopedTypeVariables]]
 
* [[Scoped type variables|ScopedTypeVariables]]
  +
* [[GHC/Stand-alone_deriving_declarations|StandaloneDeriving]]
 
* [[Template Haskell|TemplateHaskell]]
 
* [[Template Haskell|TemplateHaskell]]
* [http://downloads.haskell.org/~ghc/latest/docs/html/users_guide/exts/tuple_sections.html TupleSections] : Allow tuples to be partially applied.
+
* {{GHCUsersGuide|exts/tuple_sections||section on TupleSections}} It allows tuples to be partially applied.
 
* [[GHC/Type families|TypeFamilies]]
 
* [[GHC/Type families|TypeFamilies]]
 
* [[Undecidable instance|UndecidableInstances]]
 
* [[Undecidable instance|UndecidableInstances]]

Latest revision as of 05:36, 9 September 2021

Language extensions are used to enable language features in Haskell that may seem useful in certain cases. They can be used to loosen restrictions in the type system or add completely new language constructs to Haskell.

They can be enabled using the LANGUAGE pragma

{-# LANGUAGE <Extension>, <Extension> #-}

or (in GHC) using flags -X<Extension>.

Before just using the language extension that fits your need, think about when it is useful and what risk it may bring to your program.

List of language extensions by name

This list is far from complete and needs extension.

See also