summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <rae@richarde.dev>2020-03-17 15:22:31 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-03-18 10:07:19 -0400
commit4e8a71c1138b587dfbab8a1823b3f7fa6f0166bd (patch)
tree7d4e4f6d61951444a544cedff6c9ab6e485ab58e
parent528df8ecb4e2f9c78b1ae4ab7ff8230644e9b643 (diff)
downloadhaskell-4e8a71c1138b587dfbab8a1823b3f7fa6f0166bd.tar.gz
Add release note about fix to #16502.
We thought we needed to update the manual, but the fix for #16502 actually brings the implementation in line with the manual. So we just alert users of how to update their code.
-rw-r--r--docs/users_guide/8.12.1-notes.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/docs/users_guide/8.12.1-notes.rst b/docs/users_guide/8.12.1-notes.rst
index eecd7570fc..75adb1fb41 100644
--- a/docs/users_guide/8.12.1-notes.rst
+++ b/docs/users_guide/8.12.1-notes.rst
@@ -24,6 +24,23 @@ Language
would have accepted ``x``, but its type would have involved the mysterious ``Any``
internal type family. Now, GHC rejects, explaining the situation.
+* GHC now more faithfully implements the instance-lookup scheme described with
+ :extension:`QuantifiedConstraints`. Previous bugs meant that programs like this
+ were accepted::
+
+ data T (c :: Type -> Constraint)
+ instance (forall h. c h => Functor h) => Functor (T c)
+ instance (forall h. c h => Applicative h) => Applicative (T c)
+
+ Note that in the instance declaration for ``Applicative (T c)``, we cannot prove
+ ``Functor (T c)``, because the quantified constraint shadows the global instance.
+ There is an easy workaround, though: just include ``Functor (T c)`` as an assumption. ::
+
+ instance (forall h. c h => Applicative h, Functor (T c)) => Applicative (T c)
+
+ There is a chance we will tweak the lookup scheme in the future, to make this
+ workaround unnecessary.
+
Compiler
~~~~~~~~