From 9c5aa098ab000536caf3ac5f61d901d146d3e9d8 Mon Sep 17 00:00:00 2001 From: "bjorn@bringert.net" Date: Tue, 19 Sep 2006 01:06:06 +0000 Subject: [PATCH] First documentation on stand-alone instance deriving. --- docs/users_guide/glasgow_exts.xml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 -- 1.7.10.4