summaryrefslogtreecommitdiff
path: root/docs/users_guide/glasgow_exts.rst
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-01-03 10:51:18 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2018-01-03 11:26:20 +0000
commit298ec78c8832b391c19d662576e59c3e16bd43b0 (patch)
treeb37bb597b4e5c313e93f391d151389d6f30aba08 /docs/users_guide/glasgow_exts.rst
parentbd438b2d67ec8f5d8ac8472f13b3175b569951b9 (diff)
downloadhaskell-298ec78c8832b391c19d662576e59c3e16bd43b0.tar.gz
No deferred type errors under a forall
As Trac #14605 showed, we can't defer a type error under a 'forall' (when unifying two forall types). The fix is simple.
Diffstat (limited to 'docs/users_guide/glasgow_exts.rst')
-rw-r--r--docs/users_guide/glasgow_exts.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 03ea986de7..6704b87250 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -11231,6 +11231,29 @@ demonstrates:
Prelude> fst x
True
+Limitations of deferred type errors
+-----------------------------------
+The errors that can be deferred are:
+
+- Out of scope term variables
+- Equality constraints; e.g. `ord True` gives rise to an insoluble equality constraint `Char ~ Bool`, which can be deferred.
+- Type-class and implicit-parameter constraints
+
+All other type errors are reported immediately, and cannot be deferred; for
+example, an ill-kinded type signature, an instance declaration that is
+non-terminating or ill-formed, a type-family instance that does not
+obey the declared injectivity constraints, etc etc.
+
+In a few cases, even equality constraints cannot be deferred. Specifically:
+
+- Kind-equalities cannot be deferred, e.g. ::
+
+ f :: Int Bool -> Char
+
+ This type signature contains a kind error which cannot be deferred.
+
+- Type equalities under a forall cannot be deferred (c.f. Trac #14605).
+
.. _template-haskell:
Template Haskell