Commit 4e8a71c1 authored by Richard Eisenberg's avatar Richard Eisenberg Committed by Marge Bot
Browse files

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.
parent 528df8ec
Pipeline #16887 failed with stages
in 393 minutes and 47 seconds
......@@ -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.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment