[commit: ghc] master: relnotes: Add mention of QuantifiedConstraints (4672e2e)
git at git.haskell.org
git at git.haskell.org
Thu Jun 14 16:03:29 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/4672e2ebf040feffde4e7e2d79c479e4c0c3efaf/ghc
>---------------------------------------------------------------
commit 4672e2ebf040feffde4e7e2d79c479e4c0c3efaf
Author: Ben Gamari <ben at smart-cactus.org>
Date: Thu Jun 14 11:44:36 2018 -0400
relnotes: Add mention of QuantifiedConstraints
>---------------------------------------------------------------
4672e2ebf040feffde4e7e2d79c479e4c0c3efaf
docs/users_guide/8.6.1-notes.rst | 13 +++++++++++++
docs/users_guide/glasgow_exts.rst | 9 +++++++++
2 files changed, 22 insertions(+)
diff --git a/docs/users_guide/8.6.1-notes.rst b/docs/users_guide/8.6.1-notes.rst
index ef9a6b6..d7ba6ed 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 37ebf9c..24ae3bc 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 ::
More information about the ghc-commits
mailing list