summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-10-06 15:42:53 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-10-08 05:12:58 -0400
commite9813afceed61eb72e4c386fbc89b666c51805af (patch)
tree68dc2de59fa1a7eaaa122959ef6fe70b4619a312
parent7cd54538e0fe5be8500335b2b10ed375b852edc2 (diff)
downloadhaskell-e9813afceed61eb72e4c386fbc89b666c51805af.tar.gz
users-guide: Document -XHaskell98 and -XHaskell2010
-rw-r--r--compiler/main/DynFlags.hs3
-rw-r--r--docs/users_guide/glasgow_exts.rst39
2 files changed, 42 insertions, 0 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 146020887b..6176e2b155 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -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
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 372e0bd189..4323bee042 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -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