diff options
author | Ben Gamari <ben@smart-cactus.org> | 2018-06-14 11:44:36 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-06-14 11:48:32 -0400 |
commit | 4672e2ebf040feffde4e7e2d79c479e4c0c3efaf (patch) | |
tree | 82ed077e66953cf129b8296f3178936de6c5c3b8 /docs | |
parent | e4c41ec2b1f2f222c9c8a83ef64d4e566aa47a44 (diff) | |
download | haskell-4672e2ebf040feffde4e7e2d79c479e4c0c3efaf.tar.gz |
relnotes: Add mention of QuantifiedConstraints
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/8.6.1-notes.rst | 13 | ||||
-rw-r--r-- | docs/users_guide/glasgow_exts.rst | 9 |
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 :: |