First documentation on stand-alone instance deriving.
authorbjorn@bringert.net <unknown>
Tue, 19 Sep 2006 01:06:06 +0000 (01:06 +0000)
committerbjorn@bringert.net <unknown>
Tue, 19 Sep 2006 01:06:06 +0000 (01:06 +0000)
docs/users_guide/glasgow_exts.xml

index f8ad5c1..b46bf30 100644 (file)
@@ -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>