Commit 9c5aa098 authored by bjorn@bringert.net's avatar bjorn@bringert.net

First documentation on stand-alone instance deriving.

parent 8611d7d9
......@@ -3727,6 +3727,33 @@ the standard method is used or the one described here.)
</sect2>
<sect2 id="stand-alone-deriving">
<title>Stand-alone deriving declarations</title>
<para>
GHC now allows stand-alone <literal>deriving</literal> declarations:
</para>
<programlisting>
data Foo = Bar Int | Baz String
deriving Eq for Foo
</programlisting>
<para>Deriving instances of multi-parameter type classes for newtypes is
also allowed:</para>
<programlisting>
newtype Foo a = MkFoo (State Int a)
deriving (MonadState Int) for Foo
</programlisting>
<para>
</para>
</sect2>
<sect2 id="typing-binds">
<title>Generalised typing of mutually recursive bindings</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