summaryrefslogtreecommitdiff
path: root/docs/users_guide/using.rst
diff options
context:
space:
mode:
authorTobias Dammers <tdammers@gmail.com>2018-09-13 09:56:02 +0200
committerRichard Eisenberg <rae@cs.brynmawr.edu>2018-10-28 23:17:47 -0400
commit5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3 (patch)
tree41449e2a558385d2b290d0005fec353e6c9c88dd /docs/users_guide/using.rst
parente8a652f65318cf60e856f7c2777a003eba10ddc6 (diff)
downloadhaskell-5e45ad10ffca1ad175b10f6ef3327e1ed8ba25f3.tar.gz
Finish fix for #14880.
The real change that fixes the ticket is described in Note [Naughty quantification candidates] in TcMType. Fixing this required reworking candidateQTyVarsOfType, the function that extracts free variables as candidates for quantification. One consequence is that we now must be more careful when quantifying: any skolems around must be quantified manually, and quantifyTyVars will now only quantify over metavariables. This makes good sense, as skolems are generally user-written and are listed in the AST. As a bonus, we now have more control over the ordering of such skolems. Along the way, this commit fixes #15711 and refines the fix to #14552 (by accepted a program that was previously rejected, as we can now accept that program by zapping variables to Any). This commit also does a fair amount of rejiggering kind inference of datatypes. Notably, we now can skip the generalization step in kcTyClGroup for types with CUSKs, because we get the kind right the first time. This commit also thus fixes #15743 and #15592, which both concern datatype kind generalisation. (#15591 is also very relevant.) For this aspect of the commit, see Note [Required, Specified, and Inferred in types] in TcTyClsDecls. Test cases: dependent/should_fail/T14880{,-2}, dependent/should_fail/T15743[cd] dependent/should_compile/T15743{,e} ghci/scripts/T15743b polykinds/T15592 dependent/should_fail/T15591[bc] ghci/scripts/T15591
Diffstat (limited to 'docs/users_guide/using.rst')
-rw-r--r--docs/users_guide/using.rst11
1 files changed, 7 insertions, 4 deletions
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst
index 4373a4a8d5..e0807a9620 100644
--- a/docs/users_guide/using.rst
+++ b/docs/users_guide/using.rst
@@ -764,10 +764,13 @@ messages and in GHCi:
ghci> :i Data.Type.Equality.sym
Data.Type.Equality.sym ::
- forall (k :: BOX) (a :: k) (b :: k).
+ forall k (a :: k) (b :: k).
(a Data.Type.Equality.:~: b) -> b Data.Type.Equality.:~: a
-- Defined in Data.Type.Equality
+ This flag also enables the printing of *inferred* type variables
+ inside braces. See :ref:`inferred-vs-specified`.
+
.. ghc-flag:: -fprint-explicit-kinds
:shortdesc: Print explicit kind foralls and kind arguments in types.
See also :ghc-flag:`-XKindSignatures`
@@ -784,10 +787,10 @@ messages and in GHCi:
ghci> :set -XPolyKinds
ghci> data T a = MkT
ghci> :t MkT
- MkT :: forall (k :: BOX) (a :: k). T a
- ghci> :set -fprint-explicit-foralls
+ MkT :: forall (k :: Type) (a :: k). T a
+ ghci> :set -fprint-explicit-kinds
ghci> :t MkT
- MkT :: forall (k :: BOX) (a :: k). T k a
+ MkT :: forall (k :: Type) (a :: k). T k a
.. ghc-flag:: -fprint-explicit-runtime-reps
:shortdesc: Print ``RuntimeRep`` variables in types which are