summaryrefslogtreecommitdiff
path: root/docs/users_guide
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2012-08-20 14:26:08 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2012-08-20 14:26:08 +0100
commit00a2104b75b664026a44b26c73cc971f9733fbaa (patch)
treecf2490f4068e18f14faea1546273cf35a09b5412 /docs/users_guide
parent41c7342e7937dab55d082a0c5612f783e7eaa855 (diff)
downloadhaskell-00a2104b75b664026a44b26c73cc971f9733fbaa.tar.gz
Improve documentation for rank-1 types (Trac #7137)
Diffstat (limited to 'docs/users_guide')
-rw-r--r--docs/users_guide/glasgow_exts.xml8
1 files changed, 6 insertions, 2 deletions
diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml
index a4fb7c246c..04f6f67339 100644
--- a/docs/users_guide/glasgow_exts.xml
+++ b/docs/users_guide/glasgow_exts.xml
@@ -6384,7 +6384,7 @@ The function <literal>f3</literal> has a rank-3 type;
it has rank-2 types on the left of a function arrow.
</para>
<para>
-GHC has three flags to control higher-rank types:
+GHC has three flags to control higher-rank types. (All three imply <option>-XExplicitForAll</option>, <xref linkend="explicit-foralls"/>.)
<itemizedlist>
<listitem><para>
<option>-XPolymorphicComponents</option>: data constructors (only) can have polymorphic argument types.
@@ -6409,9 +6409,13 @@ field type signatures.</para> </listitem>
</itemizedlist>
</para></listitem>
</itemizedlist>
+Either <option>-XRank2Types</option> or <option>-XRankNTypes</option> is also required for any
+type with a <literal>forall</literal> or
+context to the right of an arrow (e.g. <literal>f :: Int -> forall a. a->a</literal>, or
+<literal>g :: Int -> Ord a => a -> a</literal>). Such types are technically rank 1, but
+are clearly not Haskell-98, and an extra flag did not seem worth the bother.
</para>
-
<sect3 id="univ">
<title>Examples
</title>