Guide to GHC Extensions

A guide to the wide variety of Haskell extensions available in GHC, aimed at people who know most of the Standard Haskell core.

The extensions which are currently covered are:

The extensions which are not currently covered, but will definitely be covered in the future, are:

  • Arrows
  • CApiFFI
  • ConstrainedClassMethods
  • ConstraintKinds
  • CPP
  • DataKinds
  • DefaultSignatures
  • DeriveDataTypeable
  • DeriveFoldable
  • DeriveFunctor
  • DeriveGeneric
  • DeriveTraversable
  • DisambiguateRecordFields
  • ExplicitNamespaces
  • ExtendedDefaultRules
  • FlexibleContexts
  • FlexibleInstances
  • ForeignFunctionInterface
  • FunctionalDependencies
  • GeneralizedNewtypeDeriving
  • GHCForeignImportPrim
  • ImplicitParams
  • ImplicitPrelude
  • IncoherentInstances
  • InstanceSigs
  • InterruptibleFFI
  • KindSignatures
  • MagicHash
  • MonoLocalBinds
  • MonomorphismRestriction
  • MonoPatBinds
  • MultiParamTypeClasses
  • NamedFieldPuns
  • OverlappingInstances
  • ParallelArrays
  • PolyKinds
  • QuasiQuotes
  • RebindableSyntax
  • RecordPuns
  • RecordWildCards
  • Safe
  • StandaloneDeriving
  • TemplateHaskell
  • TraditionalRecordSyntax
  • Trustworthy
  • TypeFamilies
  • TypeOperators
  • TypeSynonymInstances
  • UnboxedTuples
  • UndecidableInstances
  • UnliftedFFITypes
  • Unsafe

The extensions which are not currently covered, and which may or many not be covered in the future, are:

  • AlternativeLayoutRule
  • AlternativeLayoutRuleTransitional
  • DoAndIfThenElse
  • Generics
  • ImpredicativeTypes
  • NondecreasingIndentation
  • PatternSignatures
  • RelaxedLayout
  • RelaxedPolyRec

FP Haskell CenterTM
Free Community Edition

Create Projects

Type, modify, and run your code instantly. Immediately access reference guides, tutorials and live code.

Create

Share Projects

Make your Haskell code instantly accessible. People can see, edit, and run code as soon as it’s published.

Share

  • Alexander Altman

    How to Enable Extensions 30 Sep 2013Alexander Altman

    An introduction to how to enable extensions to GHC Haskell
  • Alexander Altman

    Language Standards 30 Sep 2013Alexander Altman

    [`Haskell98`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/language-standards#haskell98) and [`Haskell2010`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/language-standards#haskell2010)
  • Alexander Altman

    Basic Syntax Extensions 30 Sep 2013Alexander Altman

    [`PostfixOperators`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#postfixoperators), [`TupleSections`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#tuplesections), [`PackageImports`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#packageimports), [`OverloadedStrings`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#overloadedstrings), [`UnicodeSyntax`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#unicodesyntax), [`RecursiveDo`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#recursivedo-and-dorec), [`DoRec`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#recursivedo-and-dorec), [`LambdaCase`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#lambdacase), and [`MultiWayIf`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/basic-syntax-extensions#multiwayif)
  • Alexander Altman

    Pattern and Guard Extensions 30 Sep 2013Alexander Altman

    [`NPlusKPatterns`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/pattern-and-guard-extensions#npluskpatterns), [`BangPatterns`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/pattern-and-guard-extensions#bangpatterns), [`ViewPatterns`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/pattern-and-guard-extensions#viewpatterns), and [`PatternGuards`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/pattern-and-guard-extensions#patternguards)
  • Alexander Altman

    Explicit `forall` 30 Sep 2013Alexander Altman

    [`ExplicitForAll`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/explicit-forall#explicitforall), [`ScopedTypeVariables`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/explicit-forall#scopedtypevariables), [`LiberalTypeSynonyms`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/explicit-forall#liberaltypesynonyms), [`PolymorphicComponents`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/explicit-forall#rankntypes--rank2types--and-polymorphiccomponents), [`Rank2Types`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/explicit-forall#rankntypes--rank2types--and-polymorphiccomponents), and [`RankNTypes`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/explicit-forall#rankntypes--rank2types--and-polymorphiccomponents)
  • Alexander Altman

    List Comprehension Extensions 30 Sep 2013Alexander Altman

    [`ParallelListComp`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/list-comprehension-extensions#parallellistcomp), [`TransformListComp`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/list-comprehension-extensions#transformlistcomp), and [`MonadComprehensions`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/list-comprehension-extensions#monadcomprehensions)
  • Alexander Altman

    Data Type Extensions 30 Sep 2013Alexander Altman

    [`DatatypeContexts`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/data-type-extensions#datatypecontexts), [`EmptyDataDecls`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/data-type-extensions#emptydatadecls), [`ExistentialQuantification`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/data-type-extensions#existentialquantification), [`GADTSyntax`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/data-type-extensions#gadtsyntax), and [`GADTs`](https://www.fpcomplete.com/user/PthariensFlame/guide-to-ghc-extensions/data-type-extensions#gadts)