diff options
author | Trevis Elser <trevis@flipstone.com> | 2022-05-29 01:19:12 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-08-10 06:02:28 -0400 |
commit | dc76439de605bb833d6e226b176879cb0d5262ce (patch) | |
tree | c0a9c9d9763adca304d55416016d4b0b87448ead | |
parent | 7589ee7241d46b393979d98d4ded17a15ee974fb (diff) | |
download | haskell-dc76439de605bb833d6e226b176879cb0d5262ce.tar.gz |
Updates language extension documentation
Adding a 'Status' field with a few values:
- Deprecated
- Experimental
- InternalUseOnly
- Noting if included in 'GHC2021', 'Haskell2010' or 'Haskell98'
Those values are pulled from the existing descriptions or elsewhere in
the documentation.
While at it, include the :implied by: where appropriate, to provide
more detail.
Fixes #21475
45 files changed, 107 insertions, 59 deletions
diff --git a/docs/users_guide/bugs.rst b/docs/users_guide/bugs.rst index 2a4de4c4be..214bf21f97 100644 --- a/docs/users_guide/bugs.rst +++ b/docs/users_guide/bugs.rst @@ -147,6 +147,8 @@ Context-free syntax :since: 7.2.1 + :status: Included in :extension:`Haskell98` + Allow nested contexts to be at the same indentation level as its enclosing context. diff --git a/docs/users_guide/exts/binary_literals.rst b/docs/users_guide/exts/binary_literals.rst index d49c64ea84..29c5ad290f 100644 --- a/docs/users_guide/exts/binary_literals.rst +++ b/docs/users_guide/exts/binary_literals.rst @@ -8,6 +8,8 @@ Binary integer literals :since: 7.10.1 + :status: Included in :extension:`GHC2021` + Allow the use of binary notation in integer literals. Haskell 2010 and Haskell 98 allows for integer literals to be given in @@ -18,5 +20,3 @@ The language extension :extension:`BinaryLiterals` adds support for expressing integer literals in binary notation with the prefix ``0b`` or ``0B``. For instance, the binary integer literal ``0b11001001`` will be desugared into ``fromInteger 201`` when :extension:`BinaryLiterals` is enabled. - - diff --git a/docs/users_guide/exts/constrained_class_methods.rst b/docs/users_guide/exts/constrained_class_methods.rst index ddbb37cc52..c1630fbd54 100644 --- a/docs/users_guide/exts/constrained_class_methods.rst +++ b/docs/users_guide/exts/constrained_class_methods.rst @@ -8,6 +8,8 @@ Constrained class method types :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allows the definition of further constraints on individual class methods. Haskell 98 prohibits class method types to mention constraints on the @@ -39,5 +41,3 @@ GHC lifts this restriction with language extension :extension:`ConstrainedClassMethods`. The restriction is a pretty stupid one in the first place, so :extension:`ConstrainedClassMethods` is implied by :extension:`MultiParamTypeClasses`. - - diff --git a/docs/users_guide/exts/constraint_kind.rst b/docs/users_guide/exts/constraint_kind.rst index fd51e17859..7cbe132ff8 100644 --- a/docs/users_guide/exts/constraint_kind.rst +++ b/docs/users_guide/exts/constraint_kind.rst @@ -8,6 +8,8 @@ The ``Constraint`` kind :since: 7.4.1 + :status: Included in :extension:`GHC2021` + Allow types of kind ``Constraint`` to be used in contexts. Normally, *constraints* (which appear in types to the left of the ``=>`` diff --git a/docs/users_guide/exts/datatype_contexts.rst b/docs/users_guide/exts/datatype_contexts.rst index 240b8a332d..3848347388 100644 --- a/docs/users_guide/exts/datatype_contexts.rst +++ b/docs/users_guide/exts/datatype_contexts.rst @@ -8,6 +8,8 @@ Data type contexts :since: 7.0.1 + :status: Deprecated, Included in :extension:`Haskell98`, :extension:`Haskell2010` + Allow contexts on ``data`` types. Haskell allows datatypes to be given contexts, e.g. :: @@ -22,5 +24,3 @@ give constructors with types: :: This is widely considered a misfeature, and is going to be removed from the language. In GHC, it is controlled by the deprecated extension ``DatatypeContexts``. - - diff --git a/docs/users_guide/exts/deriving_extra.rst b/docs/users_guide/exts/deriving_extra.rst index dfbc297016..42d684f499 100644 --- a/docs/users_guide/exts/deriving_extra.rst +++ b/docs/users_guide/exts/deriving_extra.rst @@ -53,7 +53,9 @@ Deriving ``Functor`` instances :shortdesc: Enable deriving for the Functor class. Implied by :extension:`DeriveTraversable`. + :implied by: :extension:`DeriveTraversable` :since: 7.10.1 + :status: Included in :extension:`GHC2021` Allow automatic deriving of instances for the ``Functor`` typeclass. @@ -247,7 +249,9 @@ Deriving ``Foldable`` instances :shortdesc: Enable deriving for the Foldable class. Implied by :extension:`DeriveTraversable`. + :implied by: :extension:`DeriveTraversable` :since: 7.10.1 + :status: Included in :extension:`GHC2021` Allow automatic deriving of instances for the ``Foldable`` typeclass. @@ -389,6 +393,7 @@ Deriving ``Traversable`` instances Implies :extension:`DeriveFunctor` and :extension:`DeriveFoldable`. :implies: :extension:`DeriveFoldable`, :extension:`DeriveFunctor` + :implied by: :extension:`GHC2021` :since: 7.10.1 Allow automatic deriving of instances for the ``Traversable`` typeclass. @@ -465,9 +470,9 @@ Deriving ``Data`` instances .. extension:: DeriveDataTypeable :shortdesc: Enable deriving for the ``Data`` class. - Implied by (deprecated) ``AutoDeriveTypeable``. :since: 6.8.1 + :status: Included in :extension:`GHC2021` Enable automatic deriving of instances for the ``Data`` typeclass @@ -521,6 +526,7 @@ Deriving ``Lift`` instances :shortdesc: Enable deriving for the Lift class :since: 8.0.1 + :status: Included in :extension:`GHC2021` Enable automatic deriving of instances for the ``Lift`` typeclass for Template Haskell. @@ -583,5 +589,3 @@ also works for these types: lift (IntHash i) = [| IntHash i |] liftTyped (IntHash i) = [|| IntHash i ||] -} - - diff --git a/docs/users_guide/exts/duplicate_record_fields.rst b/docs/users_guide/exts/duplicate_record_fields.rst index 086aab731a..aa842e7b4f 100644 --- a/docs/users_guide/exts/duplicate_record_fields.rst +++ b/docs/users_guide/exts/duplicate_record_fields.rst @@ -7,6 +7,7 @@ Duplicate record fields :shortdesc: Allow definition of record types with identically-named fields. :implies: :extension:`DisambiguateRecordFields` + :since: 8.0.1 Allow definition of record types with identically-named fields. @@ -43,7 +44,7 @@ When :extension:`DuplicateRecordFields` is enabled, an ambiguous field must be e as part of its datatype, rather than at the top level. For example, the following is legal: :: - module M + module M ( S(x) , T(..) ) where diff --git a/docs/users_guide/exts/empty_case.rst b/docs/users_guide/exts/empty_case.rst index 7a32f609e6..e69a761bff 100644 --- a/docs/users_guide/exts/empty_case.rst +++ b/docs/users_guide/exts/empty_case.rst @@ -7,6 +7,7 @@ Empty case alternatives :shortdesc: Allow empty case alternatives. :since: 7.8.1 + :status: Included in :extension:`GHC2021` Allow empty case expressions. diff --git a/docs/users_guide/exts/empty_data_deriving.rst b/docs/users_guide/exts/empty_data_deriving.rst index 820cf35aa2..e75d9a8e41 100644 --- a/docs/users_guide/exts/empty_data_deriving.rst +++ b/docs/users_guide/exts/empty_data_deriving.rst @@ -8,6 +8,7 @@ Deriving instances for empty data types empty data types. :since: 8.4.1 + :status: Included in :extension:`Haskell2010`, :extension:`GHC2021` Allow deriving instances of standard type classes for empty data types. @@ -43,5 +44,3 @@ used in conjunction with empty data types. These include: * Type classes which require their own extensions to be enabled to be derived, such as :extension:`DeriveFunctor` (see :ref:`deriving-extra`) * :extension:`DeriveAnyClass` (see :ref:`derive-any-class`) - - diff --git a/docs/users_guide/exts/existential_quantification.rst b/docs/users_guide/exts/existential_quantification.rst index 4652f2cae0..87b15acd0d 100644 --- a/docs/users_guide/exts/existential_quantification.rst +++ b/docs/users_guide/exts/existential_quantification.rst @@ -8,6 +8,7 @@ Existentially quantified data constructors :implies: :extension:`ExplicitForAll` :since: 6.8.1 + :status: Included in :extension:`GHC2021` Allow existentially quantified type variables in types. @@ -261,5 +262,3 @@ constructors can be used. It's just about possible to imagine examples in which the derived instance would make sense, but it seems altogether simpler simply to prohibit such declarations. Define your own instances! - - diff --git a/docs/users_guide/exts/explicit_forall.rst b/docs/users_guide/exts/explicit_forall.rst index 1eeb723a84..5a6212ee4b 100644 --- a/docs/users_guide/exts/explicit_forall.rst +++ b/docs/users_guide/exts/explicit_forall.rst @@ -8,7 +8,10 @@ Explicit universal quantification (forall) Implied by :extension:`ScopedTypeVariables`, :extension:`LiberalTypeSynonyms`, :extension:`RankNTypes` and :extension:`ExistentialQuantification`. + :implied by: :extension:`ScopedTypeVariables`, :extension:`LiberalTypeSynonyms`, + :extension:`RankNTypes`, :extension:`ExistentialQuantification` :since: 6.12.1 + :status: Included in :extension:`GHC2021` Allow use of the ``forall`` keyword in places where universal quantification is implicit. diff --git a/docs/users_guide/exts/explicit_namespaces.rst b/docs/users_guide/exts/explicit_namespaces.rst index d8b8bf7fd3..64058f25de 100644 --- a/docs/users_guide/exts/explicit_namespaces.rst +++ b/docs/users_guide/exts/explicit_namespaces.rst @@ -8,6 +8,7 @@ Explicit namespaces in import/export entries in imports and exports (:ref:`explicit-namespaces`). Implied by :extension:`TypeOperators` and :extension:`TypeFamilies`. + :implied by: :extension:`TypeOperators`, :extension:`TypeFamilies` :since: 7.6.1 Enable use of explicit namespaces in module export lists. diff --git a/docs/users_guide/exts/ffi.rst b/docs/users_guide/exts/ffi.rst index eed9f5a348..b490ac662d 100644 --- a/docs/users_guide/exts/ffi.rst +++ b/docs/users_guide/exts/ffi.rst @@ -12,6 +12,8 @@ Foreign function interface (FFI) :since: 6.8.1 + :status: Included in :extension:`Haskell2010`, :extension:`GHC2021` + Allow use of the Haskell foreign function interface. GHC (mostly) conforms to the Haskell Foreign Function Interface as specified @@ -288,6 +290,8 @@ Primitive imports :since: 6.12.1 + :status: InternalUseOnly + With :extension:`GHCForeignImportPrim`, GHC extends the FFI with an additional calling convention ``prim``, e.g.: :: diff --git a/docs/users_guide/exts/field_selectors.rst b/docs/users_guide/exts/field_selectors.rst index 462596a225..513947fe4f 100644 --- a/docs/users_guide/exts/field_selectors.rst +++ b/docs/users_guide/exts/field_selectors.rst @@ -7,6 +7,7 @@ Field selectors :shortdesc: Control visibility of field selector functions. :since: 9.2.1 + :status: Included in :extension:`Haskell98`, :extension:`Haskell2010`, :extension:`GHC2021` Make `record field selector functions <https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-500003.15.1>`_ diff --git a/docs/users_guide/exts/flexible_contexts.rst b/docs/users_guide/exts/flexible_contexts.rst index 9bfccfda2a..532f3f2bb8 100644 --- a/docs/users_guide/exts/flexible_contexts.rst +++ b/docs/users_guide/exts/flexible_contexts.rst @@ -7,6 +7,7 @@ Loosening restrictions on class contexts :shortdesc: Remove some restrictions on class contexts :since: 6.8.1 + :status: Included in :extension:`GHC2021` Remove the type-variable restriction on class contexts. @@ -20,7 +21,7 @@ type-variable)* or *(class (type-variable type1 type2 ... typen))*. With This extension does not affect equality constraints in an instance context; they are permitted by :extension:`TypeFamilies` or :extension:`GADTs`. - + Note that :extension:`FlexibleContexts` affects usages of class constraints, in type signatures and other contexts. In contrast, :extension:`FlexibleInstances` loosens a similar restriction in place when declaring a new instance. diff --git a/docs/users_guide/exts/functional_dependencies.rst b/docs/users_guide/exts/functional_dependencies.rst index 7926c47efa..d8d4ca9bad 100644 --- a/docs/users_guide/exts/functional_dependencies.rst +++ b/docs/users_guide/exts/functional_dependencies.rst @@ -301,5 +301,3 @@ Although we have given only a few examples here, it should be clear that the addition of dependency information can help to make multiple parameter classes more useful in practice, avoiding ambiguity problems, and allowing more general sets of instance declarations. - - diff --git a/docs/users_guide/exts/gadt_syntax.rst b/docs/users_guide/exts/gadt_syntax.rst index c0cc6167c9..dce11eb119 100644 --- a/docs/users_guide/exts/gadt_syntax.rst +++ b/docs/users_guide/exts/gadt_syntax.rst @@ -6,8 +6,11 @@ Declaring data types with explicit constructor signatures .. extension:: GADTSyntax :shortdesc: Enable generalised algebraic data type syntax. + :implied by: :extensions:`GADTs` :since: 7.2.1 + :status: Included in :extension:`GHC2021` + Allow the use of GADT syntax in data type definitions (but not GADTs themselves; for this see :extension:`GADTs`) @@ -376,5 +379,3 @@ type declarations. infix 6 (:--:) data T a where (:--:) :: Int -> Bool -> T Int - - diff --git a/docs/users_guide/exts/generics.rst b/docs/users_guide/exts/generics.rst index 05015637aa..1cd47e2776 100644 --- a/docs/users_guide/exts/generics.rst +++ b/docs/users_guide/exts/generics.rst @@ -96,6 +96,8 @@ enabled, then it can range of types of kind ``k -> Type``, for any kind ``k``. :since: 7.2.1 + :status: Included in :extension:`GHC2021` + Allow automatic deriving of instances for the ``Generic`` typeclass. diff --git a/docs/users_guide/exts/hex_float_literals.rst b/docs/users_guide/exts/hex_float_literals.rst index 061b007dd5..c8f3708c29 100644 --- a/docs/users_guide/exts/hex_float_literals.rst +++ b/docs/users_guide/exts/hex_float_literals.rst @@ -8,6 +8,8 @@ Hexadecimal floating point literals :since: 8.4.1 + :status: Included in :extension:`GHC2021` + Allow writing floating point literals using hexadecimal notation. The hexadecimal notation for floating point literals is useful when you diff --git a/docs/users_guide/exts/import_qualified_post.rst b/docs/users_guide/exts/import_qualified_post.rst index 2adf2849e5..2719463b5b 100644 --- a/docs/users_guide/exts/import_qualified_post.rst +++ b/docs/users_guide/exts/import_qualified_post.rst @@ -8,6 +8,8 @@ Writing qualified in postpositive position :since: 8.10.1 + :status: Included in :extension:`GHC2021` + ``ImportQualifiedPost`` allows the syntax ``import M qualified``, that is, to annotate a module as qualified by writing ``qualified`` after the module name. To import a qualified module usually you must specify ``qualified`` in prepositive position : ``import qualified M``. This often leads to a "hanging indent" (which is automatically inserted by some autoformatters and common in many code bases. For example: diff --git a/docs/users_guide/exts/instances.rst b/docs/users_guide/exts/instances.rst index b8041cdb8d..e7534a8d11 100644 --- a/docs/users_guide/exts/instances.rst +++ b/docs/users_guide/exts/instances.rst @@ -45,8 +45,11 @@ Relaxed rules for the instance head :shortdesc: Enable type synonyms in instance heads. Implied by :extension:`FlexibleInstances`. + :implied by: :extension:`FlexibleInstances` :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allow definition of type class instances for type synonyms. .. extension:: FlexibleInstances @@ -54,8 +57,11 @@ Relaxed rules for the instance head Implies :extension:`TypeSynonymInstances`. :implies: :extension:`TypeSynonymInstances` + :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allow definition of type class instances with arbitrary nested types in the instance head. @@ -326,6 +332,8 @@ Overlapping instances :since: 6.8.1 + :status: Deprecated + Deprecated extension to weaken checks intended to ensure instance resolution termination. @@ -335,6 +343,8 @@ Overlapping instances :since: 6.8.1 + :status: Deprecated + Deprecated extension to weaken checks intended to ensure instance resolution termination. @@ -577,6 +587,8 @@ Instance signatures: type signatures in instance declarations :since: 7.6.1 + :status: Included in :extension:`GHC2021` + Allow type signatures for members in instance definitions. In Haskell, you can't write a type signature in an instance declaration, diff --git a/docs/users_guide/exts/kind_signatures.rst b/docs/users_guide/exts/kind_signatures.rst index 2c25033ab7..88887adc35 100644 --- a/docs/users_guide/exts/kind_signatures.rst +++ b/docs/users_guide/exts/kind_signatures.rst @@ -7,8 +7,11 @@ Explicitly-kinded quantification :shortdesc: Enable kind signatures. Implied by :extension:`TypeFamilies` and :extension:`PolyKinds`. + :implied by: :extension:`TypeFamilies`, :extension:`PolyKinds` :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allow explicit kind signatures on type variables. Haskell infers the kind of each type variable. Sometimes it is nice to @@ -61,5 +64,3 @@ The syntax is atype ::= '(' ctype '::' kind ') The parentheses are required. - - diff --git a/docs/users_guide/exts/let_generalisation.rst b/docs/users_guide/exts/let_generalisation.rst index 536f608543..bdb0c2ef86 100644 --- a/docs/users_guide/exts/let_generalisation.rst +++ b/docs/users_guide/exts/let_generalisation.rst @@ -7,6 +7,7 @@ Let-generalisation :shortdesc: Enable do not generalise local bindings. Implied by :extension:`TypeFamilies` and :extension:`GADTs`. + :implied by: :extension:`TypeFamilies`, :extension:`GADTs` :since: 6.12.1 Infer less polymorphic types for local bindings by default. diff --git a/docs/users_guide/exts/linear_types.rst b/docs/users_guide/exts/linear_types.rst index 2d6e60112b..85c440931d 100644 --- a/docs/users_guide/exts/linear_types.rst +++ b/docs/users_guide/exts/linear_types.rst @@ -5,6 +5,7 @@ Linear types :shortdesc: Enable linear types. :since: 9.0.1 + :status: Experimental Enable the linear arrow ``a %1 -> b`` and the multiplicity-polymorphic arrow ``a %m -> b``. diff --git a/docs/users_guide/exts/multi_param_type_classes.rst b/docs/users_guide/exts/multi_param_type_classes.rst index a87dba722c..9f732dfc7d 100644 --- a/docs/users_guide/exts/multi_param_type_classes.rst +++ b/docs/users_guide/exts/multi_param_type_classes.rst @@ -8,8 +8,11 @@ Multi-parameter type classes Implied by :extension:`FunctionalDependencies`. :implies: :extension:`ConstrainedClassMethods` + :implied by: :extension:`FunctionalDependencies` :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allow the definition of typeclasses with more than one parameter. Multi-parameter type classes are permitted, with extension @@ -18,4 +21,3 @@ Multi-parameter type classes are permitted, with extension class Collection c a where union :: c a -> c a -> c a ...etc. - diff --git a/docs/users_guide/exts/newtype_deriving.rst b/docs/users_guide/exts/newtype_deriving.rst index 8e91e4fb16..8856287a91 100644 --- a/docs/users_guide/exts/newtype_deriving.rst +++ b/docs/users_guide/exts/newtype_deriving.rst @@ -9,6 +9,8 @@ Generalised derived instances for newtypes :since: 6.8.1. British spelling since 8.6.1. + :status: Included in :extension:`GHC2021` + Enable GHC's cunning generalised deriving mechanism for ``newtype``\s When you define an abstract type using ``newtype``, you may want the new @@ -365,5 +367,3 @@ Note that :extension:`DerivingVia` (see :ref:`deriving-via`) uses essentially the same specification to derive instances of associated type families as well (except that it uses the ``via`` type instead of the underlying ``rep-type`` of a newtype). - - diff --git a/docs/users_guide/exts/nk_patterns.rst b/docs/users_guide/exts/nk_patterns.rst index 47d0630cec..4afd49bc5b 100644 --- a/docs/users_guide/exts/nk_patterns.rst +++ b/docs/users_guide/exts/nk_patterns.rst @@ -7,9 +7,8 @@ n+k patterns :shortdesc: Enable support for ``n+k`` patterns. Implied by :extension:`Haskell98`. - :implied by: :extension:`Haskell98` :since: 6.12.1 - Enable use of ``n+k`` patterns. - + :status: Included in :extension:`Haskell98` + Enable use of ``n+k`` patterns. diff --git a/docs/users_guide/exts/nullary_type_classes.rst b/docs/users_guide/exts/nullary_type_classes.rst index 563b98b2fb..516854f5cf 100644 --- a/docs/users_guide/exts/nullary_type_classes.rst +++ b/docs/users_guide/exts/nullary_type_classes.rst @@ -9,6 +9,8 @@ Nullary type classes :since: 7.8.1 + :status: Deprecated + Allow use and definition of type classes with no parameters. This extension has been replaced by :extension:`MultiParamTypeClasses`. @@ -35,5 +37,3 @@ dependence with: :: instance RiemannHypothesis where assumeRH = id - - diff --git a/docs/users_guide/exts/nullary_types.rst b/docs/users_guide/exts/nullary_types.rst index 1128faeb00..2ce85cb9d9 100644 --- a/docs/users_guide/exts/nullary_types.rst +++ b/docs/users_guide/exts/nullary_types.rst @@ -8,6 +8,8 @@ Data types with no constructors :since: 6.8.1 + :status: Included in :extension:`GHC2021` and :extension:`Haskell2010` + Allow definition of empty ``data`` types. With the :extension:`EmptyDataDecls` extension, GHC lets you declare a @@ -34,4 +36,3 @@ can be useful when defining "phantom types". In conjunction with the :extension:`EmptyDataDeriving` extension, empty data declarations can also derive instances of standard type classes (see :ref:`empty-data-deriving`). - diff --git a/docs/users_guide/exts/numeric_underscores.rst b/docs/users_guide/exts/numeric_underscores.rst index d430fcde26..7a96e00d88 100644 --- a/docs/users_guide/exts/numeric_underscores.rst +++ b/docs/users_guide/exts/numeric_underscores.rst @@ -8,6 +8,8 @@ Numeric underscores :since: 8.6.1 + :status: Included in :extension:`GHC2021` + Allow the use of underscores in numeric literals. GHC allows for numeric literals to be given in decimal, octal, hexadecimal, @@ -85,5 +87,3 @@ About validity: h2 = 0x_ffff -- valid h3 = 0x__ffff -- valid h4 = _0xffff -- invalid - - diff --git a/docs/users_guide/exts/package_qualified_imports.rst b/docs/users_guide/exts/package_qualified_imports.rst index d0e632307d..e43473f75d 100644 --- a/docs/users_guide/exts/package_qualified_imports.rst +++ b/docs/users_guide/exts/package_qualified_imports.rst @@ -31,5 +31,3 @@ package being built. from one package to another, rendering any package-qualified imports broken. See also :ref:`package-thinning-and-renaming` for an alternative way of disambiguating between module names. - - diff --git a/docs/users_guide/exts/partial_type_signatures.rst b/docs/users_guide/exts/partial_type_signatures.rst index c2909ed2d0..6b3b88a59c 100644 --- a/docs/users_guide/exts/partial_type_signatures.rst +++ b/docs/users_guide/exts/partial_type_signatures.rst @@ -125,6 +125,8 @@ Named Wildcards :since: 7.10.1 + :status: Included in :extension:`GHC2021` + Allow naming of wildcards (e.g. ``_x``) in type signatures. Type wildcards can also be named by giving the underscore an identifier @@ -355,5 +357,3 @@ splices. {-# LANGUAGE TemplateHaskell #-} foo :: $( [t| _ |] ) -> a foo x = x - - diff --git a/docs/users_guide/exts/pattern_guards.rst b/docs/users_guide/exts/pattern_guards.rst index cfa6b7783d..5ca2c95403 100644 --- a/docs/users_guide/exts/pattern_guards.rst +++ b/docs/users_guide/exts/pattern_guards.rst @@ -7,10 +7,8 @@ Pattern guards :shortdesc: Disable pattern guards. Implied by :extension:`Haskell98`. - :implied by: :extension:`Haskell98` :since: 6.8.1 + :status: Included in :extension:`Haskell98` Disable `pattern guards <https://www.haskell.org/onlinereport/haskell2010/haskellch3.html#x8-460003.13>`__. - - diff --git a/docs/users_guide/exts/poly_kinds.rst b/docs/users_guide/exts/poly_kinds.rst index 5eef04dbd2..f72b20b790 100644 --- a/docs/users_guide/exts/poly_kinds.rst +++ b/docs/users_guide/exts/poly_kinds.rst @@ -9,6 +9,7 @@ Kind polymorphism :implies: :extension:`PolyKinds`, :extension:`DataKinds`, :extension:`KindSignatures` :since: 8.0.1 + :status: Deprecated The extension :extension:`TypeInType` is now deprecated: its sole effect is to switch on :extension:`PolyKinds` @@ -21,6 +22,8 @@ Kind polymorphism :implies: :extension:`KindSignatures` :since: 7.4.1 + :status: Included in :extension:`GHC2021` + Allow kind polymorphic types. This section describes GHC's kind system, as it appears in version 8.0 and beyond. @@ -251,6 +254,7 @@ Complete user-supplied kind signatures and polymorphic recursion :shortdesc: Enable detection of complete user-supplied kind signatures. :since: 8.10.1 + :status: Included in :extension:`Haskell98`, :extension:`Haskell2010` NB! This is a legacy feature, see :extension:`StandaloneKindSignatures` for the modern replacement. @@ -384,6 +388,7 @@ Standalone kind signatures and polymorphic recursion :implies: :extension:`NoCUSKs` :since: 8.10.1 + :status: Included in :extension:`GHC2021` Just as in type inference, kind inference for recursive types can only use *monomorphic* recursion. Consider this (contrived) example: :: @@ -904,6 +909,7 @@ The kind ``Type`` :shortdesc: Treat ``*`` as ``Data.Kind.Type``. :since: 8.6.1 + :status: Included in :extension:`Haskell98`, :extension:`Haskell2010`, :extension:`GHC2021` Treat the unqualified uses of the ``*`` type operator as nullary and desugar to ``Data.Kind.Type``. @@ -1085,5 +1091,3 @@ Examples:: single: TYPE single: levity polymorphism single: representation polymorphism - - diff --git a/docs/users_guide/exts/primitives.rst b/docs/users_guide/exts/primitives.rst index 1a81d9ea53..a596c13f23 100644 --- a/docs/users_guide/exts/primitives.rst +++ b/docs/users_guide/exts/primitives.rst @@ -150,7 +150,6 @@ Unboxed tuples :since: 6.8.1 - Unboxed tuples aren't really exported by ``GHC.Exts``; they are a syntactic extension (:extension:`UnboxedTuples`). An unboxed tuple looks like this: :: @@ -213,6 +212,7 @@ Unboxed sums .. extension:: UnboxedSums :shortdesc: Enable unboxed sums. + :implied by: :extension:`UnboxedTuples` :since: 8.2.1 Enable the use of unboxed sum syntax. diff --git a/docs/users_guide/exts/rank_polymorphism.rst b/docs/users_guide/exts/rank_polymorphism.rst index 75066e8c7f..9c9e40012b 100644 --- a/docs/users_guide/exts/rank_polymorphism.rst +++ b/docs/users_guide/exts/rank_polymorphism.rst @@ -9,6 +9,7 @@ Arbitrary-rank polymorphism :implies: :extension:`ExplicitForAll` :since: 6.8.1 + :status: Included in :extension:`GHC2021` Allow types of arbitrary rank. @@ -17,6 +18,7 @@ Arbitrary-rank polymorphism Synonym for :extension:`RankNTypes`. :since: 6.8.1 + :status: Deprecated A deprecated alias of :extension:`RankNTypes`. @@ -342,5 +344,3 @@ so no implicit quantification happens, and the declaration is rejected (with "``f`` is out of scope"). Solution: use an explicit ``forall``: :: data PackMap a b s t = PackMap (forall f. Monad f => (a -> f b) -> s -> f t) - - diff --git a/docs/users_guide/exts/rebindable_syntax.rst b/docs/users_guide/exts/rebindable_syntax.rst index 3a091bc7fb..3b41d5097b 100644 --- a/docs/users_guide/exts/rebindable_syntax.rst +++ b/docs/users_guide/exts/rebindable_syntax.rst @@ -7,6 +7,7 @@ Rebindable syntax and the implicit Prelude import :shortdesc: Don't implicitly ``import Prelude``. Implied by :extension:`RebindableSyntax`. + :implied by: :extension:`RebindableSyntax` :since: 6.8.1 Don't import ``Prelude`` by default. @@ -126,6 +127,7 @@ Postfix operators :shortdesc: Enable postfix operators. :since: 7.10.1 + :status: Included in :extension:`GHC2021` Allow the use of post-fix operators @@ -151,5 +153,3 @@ function postfix. The extension does not extend to the left-hand side of function definitions; you must define such a function in prefix form. - - diff --git a/docs/users_guide/exts/record_puns.rst b/docs/users_guide/exts/record_puns.rst index 876db0623f..c1bfc6fad8 100644 --- a/docs/users_guide/exts/record_puns.rst +++ b/docs/users_guide/exts/record_puns.rst @@ -8,6 +8,8 @@ Record puns :since: 6.10.1 + :status: Included in :extension:`GHC2021` + Allow use of record puns. Record puns are enabled by the language extension :extension:`NamedFieldPuns`. @@ -61,5 +63,3 @@ Note that: (This is useful if the field selector ``a`` for constructor ``M.C`` is only in scope in qualified form.) - - diff --git a/docs/users_guide/exts/scoped_type_variables.rst b/docs/users_guide/exts/scoped_type_variables.rst index fa117fc032..ee6a77f32a 100644 --- a/docs/users_guide/exts/scoped_type_variables.rst +++ b/docs/users_guide/exts/scoped_type_variables.rst @@ -9,8 +9,11 @@ Lexically scoped type variables :shortdesc: Enable lexically-scoped type variables. :implies: :extension:`ExplicitForAll` + :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Enable lexical scoping of type variables explicitly introduced with ``forall``. diff --git a/docs/users_guide/exts/standalone_deriving.rst b/docs/users_guide/exts/standalone_deriving.rst index e5085953d4..ef2bd86d28 100644 --- a/docs/users_guide/exts/standalone_deriving.rst +++ b/docs/users_guide/exts/standalone_deriving.rst @@ -8,6 +8,8 @@ Stand-alone deriving declarations :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allow the use of stand-alone ``deriving`` declarations. GHC allows stand-alone ``deriving`` declarations, enabled by @@ -111,5 +113,3 @@ ordinary deriving: GHC always treats the *last* parameter of the instance (``Foo`` in this example) as the type whose instance is being derived. - - diff --git a/docs/users_guide/exts/strict.rst b/docs/users_guide/exts/strict.rst index 75051a9d5f..8c0925fdba 100644 --- a/docs/users_guide/exts/strict.rst +++ b/docs/users_guide/exts/strict.rst @@ -41,6 +41,8 @@ Bang patterns :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allow use of bang pattern syntax. GHC supports an extension of pattern matching called *bang patterns*, @@ -197,6 +199,7 @@ Strict-by-default pattern bindings :shortdesc: Make bindings in the current module strict by default. :implies: :extension:`StrictData` + :since: 8.0.1 Make bindings in the current module strict by default. @@ -511,6 +514,3 @@ intuitive: :: let f = /\a \(d::Eq a). fst (member, True) in body Note that the bang has no effect at all in this case - - - diff --git a/docs/users_guide/exts/tuple_sections.rst b/docs/users_guide/exts/tuple_sections.rst index 463b451d26..d031535831 100644 --- a/docs/users_guide/exts/tuple_sections.rst +++ b/docs/users_guide/exts/tuple_sections.rst @@ -8,6 +8,8 @@ Tuple sections :since: 6.12 + :status: Included in :extension:`GHC2021` + Allow the use of tuple section syntax The :extension:`TupleSections` extension enables partially applied @@ -39,5 +41,3 @@ Because there is no unboxed unit tuple, the following expression :: (# #) continues to stand for the unboxed singleton tuple data constructor. - - diff --git a/docs/users_guide/exts/type_applications.rst b/docs/users_guide/exts/type_applications.rst index 00b33fe3fc..d2a0e4ca16 100644 --- a/docs/users_guide/exts/type_applications.rst +++ b/docs/users_guide/exts/type_applications.rst @@ -8,6 +8,8 @@ Visible type application :since: 8.0.1 + :status: Included in :extension:`GHC2021` + Allow the use of type application syntax. The :extension:`TypeApplications` extension allows you to use @@ -322,7 +324,7 @@ Type arguments appearing in patterns can influence the inferred type of a defini foo (Nothing @Int) = 0 foo (Just x) = x -will have inferred type:: +will have inferred type:: foo :: Maybe Int -> Int diff --git a/docs/users_guide/exts/type_families.rst b/docs/users_guide/exts/type_families.rst index e040896235..c185592bb5 100644 --- a/docs/users_guide/exts/type_families.rst +++ b/docs/users_guide/exts/type_families.rst @@ -10,6 +10,7 @@ Type families :implies: :extension:`MonoLocalBinds`, :extension:`KindSignatures`, :extension:`ExplicitNamespaces` + :implied by: :extension:`TypeFamilyDependencies` :since: 6.8.1 Allow use and definition of indexed type and data families. @@ -1129,6 +1130,7 @@ Injective type families Implies :extension:`TypeFamilies`. :implies: :extension:`TypeFamilies` + :since: 8.0.1 Allow functional dependency annotations on type families. This allows one to @@ -1251,5 +1253,3 @@ injectivity of a type family: Note that for the purpose of injectivity check in bullets (4) and (5) GHC uses a special variant of unification algorithm that treats type family applications as possibly unifying with anything. - - diff --git a/docs/users_guide/exts/type_operators.rst b/docs/users_guide/exts/type_operators.rst index d6e343c90e..30886913d5 100644 --- a/docs/users_guide/exts/type_operators.rst +++ b/docs/users_guide/exts/type_operators.rst @@ -8,8 +8,11 @@ Type operators Implies :extension:`ExplicitNamespaces`. :implies: :extension:`ExplicitNamespaces` + :since: 6.8.1 + :status: Included in :extension:`GHC2021` + Allow the use and definition of types with operator names. The language :extension:`TypeOperators` allows you to use infix operators @@ -29,7 +32,7 @@ in types. x :: Int `Either` Bool x = Left 5 - + - There is now some potential ambiguity in import and export lists; for example if you write ``import M( (+) )`` do you mean the *function* ``(+)`` or the *type constructor* ``(+)``? The default is the former, |