Commit a3e69154 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Wibbles to documentation for promoted lists and tuples (Trac #9882)

parent a972bddf
......@@ -6884,7 +6884,7 @@ is a single quote.</para>
<sect2 id="promoted-lists-and-tuples">
<title>Promoted list and tuple types</title>
<para>
With <option>-XTypeOperators</option>, Haskell's list and tuple types are natively promoted to kinds, and enjoy the
With <option>-XDataKinds</option>, Haskell's list and tuple types are natively promoted to kinds, and enjoy the
same convenient syntax at the type level, albeit prefixed with a quote:
<programlisting>
data HList :: [*] -> * where
......@@ -6903,10 +6903,12 @@ foo1 = HCons (3::Int) HNil
foo2 :: HList [Int, Bool]
foo2 = ...
</programlisting>
(Note: the declaration for <literal>HCons</literal> also requires <option>-XTypeOperators</option>
because of infix type operator <literal>(:')</literal>.)
For type-level lists of <emphasis>two or more elements</emphasis>,
such as the signature of <literal>foo2</literal> above, the quote may be omitted because the meaning is
umambiguous. But for lists of one or zero elements (as in <literal>foo0</literal>
and <literal>foo1</literal>), the quote is required, becuase the types <literal>[]</literal>
unambiguous. But for lists of one or zero elements (as in <literal>foo0</literal>
and <literal>foo1</literal>), the quote is required, because the types <literal>[]</literal>
and <literal>[Int]</literal> have existing meanings in Haskell.
</para>
</sect2>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment