summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Eisenberg <eir@cis.upenn.edu>2016-01-10 19:10:03 -0500
committerRichard Eisenberg <eir@cis.upenn.edu>2016-01-15 15:43:44 -0500
commit3a7f204f5d713ed4ac034d371fc10d8bedb39efa (patch)
tree242547bb1ab0ca347cf9fad840d7b7604d9f99c9
parent6c07f1426e58232092043e28d56717aa489d3670 (diff)
downloadhaskell-3a7f204f5d713ed4ac034d371fc10d8bedb39efa.tar.gz
Clarify topological sorting of spec vars in manual
This is mentioned in #11376.
-rw-r--r--docs/users_guide/glasgow_exts.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 0ec5bd4f1c..e77a7c0243 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -2237,6 +2237,15 @@ Here are the details:
will have its type variables
ordered as ``m, a, b, c``.
+- If any of the variables depend on other variables (that is, if some
+ of the variables are *kind* variables), the variables are reordered
+ so that kind variables come before type variables, preserving the
+ left-to-right order as much as possible. That is, GHC performs a
+ stable topological sort on the variables.
+
+ For example: if we have ``bar :: Proxy (a :: (j, k)) -> b``, then
+ the variables are ordered ``j``, ``k``, ``a``, ``b``.
+
- Class methods' type arguments include the class type
variables, followed by any variables an individual method is polymorphic
in. So, ``class Monad m where return :: a -> m a`` means