From: simonpj Date: Thu, 23 Jan 2003 14:55:56 +0000 (+0000) Subject: [project @ 2003-01-23 14:55:56 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1243 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0e42af3be366e0aaa2b6bc2d97eb5818395ac713;p=ghc-hetmet.git [project @ 2003-01-23 14:55:56 by simonpj] Refine documentation of newtype-deriving stuff --- diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index 6b3bd13..bf77796 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -3153,13 +3153,26 @@ declaration (after expansion of any type synonyms) newtype T v1...vn = T' (S t1...tk vk+1...vn) deriving (c1...cm) -where S is a type constructor, t1...tk are -types, -vk+1...vn are type variables which do not occur in any of -the ti, and the ci are partial applications of -classes of the form C t1'...tj'. The derived instance -declarations are, for each ci, - +where + + + S is a type constructor, + + + t1...tk are types, + + + vk+1...vn are type variables which do not occur in any of + the ti, and + + + the ci are partial applications of + classes of the form C t1'...tj', where the arity of C + is exactly j+1. That is, C lacks exactly one type argument. + + +Then, for each ci, the derived instance +declaration is: instance ci (S t1...tk vk+1...v) => ci (T v1...vp)