[Git][ghc/ghc][master] Add release note about fix to #16502.

Marge Bot gitlab at gitlab.haskell.org
Wed Mar 18 14:07:28 UTC 2020



 Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
4e8a71c1 by Richard Eisenberg at 2020-03-18T14:07:19Z
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.

- - - - -


1 changed file:

- docs/users_guide/8.12.1-notes.rst


Changes:

=====================================
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
 ~~~~~~~~
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/4e8a71c1138b587dfbab8a1823b3f7fa6f0166bd

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/commit/4e8a71c1138b587dfbab8a1823b3f7fa6f0166bd
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200318/5fd8baed/attachment-0001.html>


More information about the ghc-commits mailing list