diff options
author | Ian Lynagh <igloo@earth.li> | 2010-12-18 15:01:21 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-12-18 15:01:21 +0000 |
commit | 14f9af49db1672e023ac8d8c506b42bc5400a787 (patch) | |
tree | 370ff36206ce3b69213c56965c96f340f773ca76 /docs | |
parent | 8415c28b4ff37abf52d35af87e3435769b2ef6d8 (diff) | |
download | haskell-14f9af49db1672e023ac8d8c506b42bc5400a787.tar.gz |
Document GADTSyntax extension
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/flags.xml | 7 | ||||
-rw-r--r-- | docs/users_guide/glasgow_exts.xml | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/docs/users_guide/flags.xml b/docs/users_guide/flags.xml index 2bcb5e6d93..a9c018415b 100644 --- a/docs/users_guide/flags.xml +++ b/docs/users_guide/flags.xml @@ -763,6 +763,13 @@ <entry><option>-XNoGADTs</option></entry> </row> <row> + <entry><option>-XGADTSyntax</option></entry> + <entry>Enable <link linkend="gadt-style">generalised algebraic data type syntax</link>. + </entry> + <entry>dynamic</entry> + <entry><option>-XNoGADTSyntax</option></entry> + </row> + <row> <entry><option>-XTypeFamilies</option></entry> <entry>Enable <link linkend="type-families">type families</link>.</entry> <entry>dynamic</entry> diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index a1930880d6..ddbd2ec0aa 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -2434,7 +2434,8 @@ declarations. Define your own instances! <sect2 id="gadt-style"> <title>Declaring data types with explicit constructor signatures</title> -<para>GHC allows you to declare an algebraic data type by +<para>When the <literal>GADTSyntax</literal> extension is enabled, +GHC allows you to declare an algebraic data type by giving the type signatures of constructors explicitly. For example: <programlisting> data Maybe a where |