summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/users_guide/8.6.1-notes.rst13
-rw-r--r--docs/users_guide/glasgow_exts.rst9
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst
index ef9a6b6955..d7ba6ed542 100644
--- a/docs/users_guide/8.6.1-notes.rst
+++ b/docs/users_guide/8.6.1-notes.rst
@@ -28,6 +28,19 @@ Full details
Language
~~~~~~~~
+
+- Use of quantified type variables in constraints is now allowed via the
+ :extension:`QuantifiedConstraints` language extension. This long-awaited feature
+ enables users to encode significantly more precision in their types. For instance,
+ the common ``MonadTrans`` typeclass could now make the expectation that an
+ applied transformer is must be a ``Monad`` ::
+
+ class (forall a. Monad m => Monad (t m)) => MonadTrans t where {- ... -}
+
+ Additionally, quantification can enable terminating instance resolution
+ where this previously was not possible. See :ref:`quantified-constraints` for
+ details.
+
- A new :extension:`DerivingVia` language extension has been added which allows
the use of the ``via`` deriving strategy. For instance: ::
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 37ebf9cca0..24ae3bcbdc 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -9707,9 +9707,18 @@ contexts and superclasses, but to do so you must use
:extension:`UndecidableInstances` to signal that you don't mind if the type
checker fails to terminate.
+.. _quantified-constraints:
+
Quantified constraints
======================
+.. extension:: QuantifiedConstraints
+ :shortdesc: Allow ``forall`` quantifiers in constraints.
+
+ :since: 8.6.1
+
+ Allow constraints to quantify over types.
+
The extension :extension:`QuantifiedConstraints` introduces **quantified constraints**,
which give a new level of expressiveness in constraints. For example, consider ::