Commit adbd30cd authored by jpm@cs.ox.ac.uk's avatar jpm@cs.ox.ac.uk

Use a separate user's guide section for -XAutoDeriveTypeable

parent 72b0ba09
......@@ -1062,7 +1062,7 @@
</row>
<row>
<entry><option>-XAutoDeriveTypeable</option></entry>
<entry>Automatically derive Typeable instances for every datatype and type class declaration.</entry>
<entry>Automatically <link linkend="auto-derive-typeable">derive Typeable instances for every datatype and type class declaration</link>.</entry>
<entry>dynamic</entry>
<entry><option>-XNoAutoDeriveTypeable</option></entry>
</row>
......
......@@ -3385,9 +3385,7 @@ type class. Instances for datatypes can be derived by attaching a
<literal>deriving Typeable</literal> clause to the datatype declaration, or by
using standalone deriving (see <xref linkend="stand-alone-deriving"/>).
Instances for type classes can only be derived using standalone deriving.
Additionally, <option>-XAutoDeriveTypeable</option> will trigger the generation
of derived <literal>Typeable</literal> instances for every datatype and type
class declaration in the module it is used.
See also <xref linkend="auto-derive-typeable"/>.
</para>
<para>
Also since GHC 7.8.1, handwritten (ie. not derived) instances of
......@@ -3422,6 +3420,17 @@ can be mentioned in the <literal>deriving</literal> clause.
</para>
</sect2>
<sect2 id="auto-derive-typeable">
<title>Automatically deriving <literal>Typeable</literal> instances</title>
<para>
The flag <option>-XAutoDeriveTypeable</option> triggers the generation
of derived <literal>Typeable</literal> instances for every datatype and type
class declaration in the module it is used.
</para>
</sect2>
<sect2 id="newtype-deriving">
<title>Generalised derived instances for newtypes</title>
......
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