summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2016-03-19 16:55:50 -0400
committerRichard Eisenberg <eir@cis.upenn.edu>2016-03-21 12:16:12 -0400
commit35e937973f61a7e5534ecd0b1c67111cd82d4238 (patch)
tree515dd4f04763c179dad1ae1ed29ed4e5b3459bc8 /docs
parent947709395015bd6122eedc6da5df356660e76208 (diff)
downloadhaskell-35e937973f61a7e5534ecd0b1c67111cd82d4238.tar.gz
Track specified/invisible more carefully.
In particular, this allows correct tracking of specified/invisible for variables in Haskell98 data constructors and in pattern synonyms. GADT-syntax constructors are harder, and are left until #11721. This was all inspired by Simon's comments to my fix for #11512, which this subsumes. Test case: ghci/scripts/TypeAppData [skip ci] (The test case fails because of an unrelated problem fixed in the next commit.)
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/glasgow_exts.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 25fbb23e64..f5f266a52c 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -8709,6 +8709,19 @@ Here are the details:
signature, ``myLength``'s inferred type will be
``forall {f} {a}. Foldable f => f a -> Int``.
+- Data constructors declared with GADT syntax follow different rules
+ for the time being; it is expected that these will be brought in line
+ with other declarations in the future. The rules for GADT
+ data constructors are as follows:
+ * All kind and type variables are considered specified and available for
+ visible type application.
+ * Universal variables always come first, in precisely the order they
+ appear in the type delcaration. Universal variables that are
+ constrained by a GADT return type are not included in the data constructor.
+ * Existential variables come next. Their order is determined by a user-
+ written `forall`; or, if there is none, by taking the left-to-right order
+ in the data constructor's type and doing a stable topological sort.
+
.. _implicit-parameters:
Implicit parameters