From: bjorn@bringert.net Date: Tue, 19 Sep 2006 01:06:06 +0000 (+0000) Subject: First documentation on stand-alone instance deriving. X-Git-Tag: 2006-10-05~11 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=9c5aa098ab000536caf3ac5f61d901d146d3e9d8 First documentation on stand-alone instance deriving. --- diff --git a/docs/users_guide/glasgow_exts.xml b/docs/users_guide/glasgow_exts.xml index f8ad5c1..b46bf30 100644 --- a/docs/users_guide/glasgow_exts.xml +++ b/docs/users_guide/glasgow_exts.xml @@ -3727,6 +3727,33 @@ the standard method is used or the one described here.) + +Stand-alone deriving declarations + + +GHC now allows stand-alone deriving declarations: + + + + data Foo = Bar Int | Baz String + + deriving Eq for Foo + + +Deriving instances of multi-parameter type classes for newtypes is +also allowed: + + + newtype Foo a = MkFoo (State Int a) + + deriving (MonadState Int) for Foo + + + + + + + Generalised typing of mutually recursive bindings