summaryrefslogtreecommitdiff
path: root/docs/users_guide
diff options
context:
space:
mode:
authorVladislav Zavialov <vlad.z.4096@gmail.com>2019-05-09 01:53:26 +0300
committerVladislav Zavialov <vlad.z.4096@gmail.com>2019-05-10 20:30:50 +0300
commitd0d3d38a260695953e0244a75a67ef78ea23d119 (patch)
tree4748d0f0eae33f34c3e4cd0cd9527c0f42f52b6c /docs/users_guide
parent396e01b472bba36530e7eb065b82d311f0da7880 (diff)
downloadhaskell-wip/cusk-ext.tar.gz
Guard CUSKs behind a language pragmawip/cusk-ext
GHC Proposal #36 describes a transition plan away from CUSKs and to top-level kind signatures: 1. Introduce a new extension, -XCUSKs, on by default, that detects CUSKs as they currently exist. 2. We turn off the -XCUSKs extension in a few releases and remove it sometime thereafter. This patch implements phase 1 of this plan, introducing a new language extension to control whether CUSKs are enabled. When top-level kind signatures are implemented, we can transition to phase 2.
Diffstat (limited to 'docs/users_guide')
-rw-r--r--docs/users_guide/glasgow_exts.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/users_guide/glasgow_exts.rst b/docs/users_guide/glasgow_exts.rst
index 5fef204831..bce2bf8370 100644
--- a/docs/users_guide/glasgow_exts.rst
+++ b/docs/users_guide/glasgow_exts.rst
@@ -9012,6 +9012,11 @@ do so.
Complete user-supplied kind signatures and polymorphic recursion
----------------------------------------------------------------
+.. extension:: CUSKs
+ :shortdesc: Enable detection of complete user-supplied kind signatures.
+
+ :since: 8.10.1
+
Just as in type inference, kind inference for recursive types can only
use *monomorphic* recursion. Consider this (contrived) example: ::
@@ -9110,6 +9115,13 @@ example, consider ::
According to the rules above ``X`` has a CUSK. Yet, the kind of ``k`` is undetermined.
It is thus quantified over, giving ``X`` the kind ``forall k1 (k :: k1). Proxy k -> Type``.
+The detection of CUSKs is enabled by the :extension:`CUSKs` flag, which is
+switched on by default. When :extension:`CUSKs` is switched off, there is
+currently no way to enable polymorphic recursion in types. In the future, the
+notion of a CUSK will be replaced by top-level kind signatures
+(`GHC Proposal #36 <https://github.com/ghc-proposals/ghc-proposals/blob/master/proposals/0036-kind-signatures.rst>`__),
+then, after a transition period, this extension will be turned off by default, and eventually removed.
+
Kind inference in closed type families
--------------------------------------