summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authormynguyen <mnguyen1@brynmawr.edu>2018-12-18 11:52:26 -0500
committerRichard Eisenberg <rae@cs.brynmawr.edu>2019-01-03 08:57:32 -0500
commit17bd163566153babbf51adaff8397f948ae363ca (patch)
treeef25e933481def276de4cdcad77eb4a34a76444b /docs
parent6e4e63764aaf558cf177c2a9c2da345b2a360ea6 (diff)
downloadhaskell-17bd163566153babbf51adaff8397f948ae363ca.tar.gz
Visible kind application
Summary: This patch implements visible kind application (GHC Proposal 15/#12045), as well as #15360 and #15362. It also refactors unnamed wildcard handling, and requires that type equations in type families in Template Haskell be written with full type on lhs. PartialTypeSignatures are on and warnings are off automatically with visible kind application, just like in term-level. There are a few remaining issues with this patch, as documented in ticket #16082. Includes a submodule update for Haddock. Test Plan: Tests T12045a/b/c/TH1/TH2, T15362, T15592a Reviewers: simonpj, goldfire, bgamari, alanz, RyanGlScott, Iceland_jack Subscribers: ningning, Iceland_jack, RyanGlScott, int-index, rwbarton, mpickering, carter GHC Trac Issues: `#12045`, `#15362`, `#15592`, `#15788`, `#15793`, `#15795`, `#15797`, `#15799`, `#15801`, `#15807`, `#15816` Differential Revision: https://phabricator.haskell.org/D5229
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/glasgow_exts.rst18
1 files changed, 11 insertions, 7 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 0ef0d053af..b1e9bc6722 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -10686,7 +10686,7 @@ Visible type application
========================
.. extension:: TypeApplications
- :shortdesc: Enable type application syntax.
+ :shortdesc: Enable type application syntax in terms and types.
:since: 8.0.1
@@ -10707,6 +10707,10 @@ is an identifier (the common case), its type is considered known only when
the identifier has been given a type signature. If the identifier does
not have a type signature, visible type application cannot be used.
+GHC also permits visible kind application, where users can declare the kind
+arguments to be instantiated in kind-polymorphic cases. Its usage parallels
+visible type application in the term level, as specified above.
+
.. _inferred-vs-specified:
Inferred vs. specified type variables
@@ -10864,8 +10868,8 @@ the rules in the subtler cases:
application. If you want to specify only the second type argument to
``wurble``, then you can say ``wurble @_ @Int``.
The first argument is a wildcard, just like in a partial type signature.
- However, if used in a visible type application, it is *not*
- necessary to specify :extension:`PartialTypeSignatures` and your
+ However, if used in a visible type application/visible kind application,
+ it is *not* necessary to specify :extension:`PartialTypeSignatures` and your
code will not generate a warning informing you of the omitted type.
The section in this manual on kind polymorphism describes how variables
@@ -12251,10 +12255,10 @@ Anonymous and named wildcards *can* occur on the left hand side of a
type or data instance declaration;
see :ref:`type-wildcards-lhs`.
-Anonymous wildcards are also allowed in visible type applications
-(:ref:`visible-type-application`). If you want to specify only the second type
-argument to ``wurble``, then you can say ``wurble @_ @Int`` where the first
-argument is a wildcard.
+Anonymous wildcards are also allowed in visible type applications/ visible kind
+applications (:ref:`visible-type-application`). If you want to specify only the
+second type argument to ``wurble``, then you can say ``wurble @_ @Int`` where
+the first argument is a wildcard.
Standalone ``deriving`` declarations permit the use of a single,
extra-constraints wildcard, like so: ::