Commit e9813afc authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Marge Bot
Browse files

users-guide: Document -XHaskell98 and -XHaskell2010

parent 7cd54538
......@@ -2296,6 +2296,9 @@ flattenExtensionFlags ml = foldr f defaultExtensionFlags
f (Off f) flags = EnumSet.delete f flags
defaultExtensionFlags = EnumSet.fromList (languageExtensions ml)
-- | The language extensions implied by the various language variants.
-- When updating this be sure to update the flag documentation in
-- @docs/users-guide/glasgow_exts.rst@.
languageExtensions :: Maybe Language -> [LangExt.Extension]
languageExtensions Nothing
......
......@@ -67,6 +67,45 @@ a large swath of the extensions supported by GHC at once.
to move away from this portmanteau flag, and towards enabling features
individually.
 
.. extension:: Haskell2010
:shortdesc: Use the Haskell 2010 language variant.
Compile Haskell 2010 language variant. Enables the
following language extensions:
.. hlist::
* :extension:`ImplicitPrelude`
* :extension:`StarIsType`
* :extension:`CUSKs`
* :extension:`MonomorphismRestriction`
* :extension:`DatatypeContexts`
* :extension:`TraditionalRecordSyntax`
* :extension:`EmptyDataDecls`
* :extension:`ForeignFunctionInterface`
* :extension:`PatternGuards`
* :extension:`DoAndIfThenElse`
* :extension:`RelaxedPolyRec`
.. extension:: Haskell98
:shortdesc: Use the Haskell 2010 language variant.
Compile using Haskell 98 language variant. Enables the
following language extensions:
.. hlist::
* :extension:`ImplicitPrelude`
* :extension:`StarIsType`
* :extension:`CUSKs`
* :extension:`MonomorphismRestriction`
* :extension:`NPlusKPatterns`
* :extension:`DatatypeContexts`
* :extension:`TraditionalRecordSyntax`
* :extension:`NondecreasingIndentation`
.. _primitives:
 
Unboxed types and primitive operations
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment