From 0e42af3be366e0aaa2b6bc2d97eb5818395ac713 Mon Sep 17 00:00:00 2001 From: simonpj Date: Thu, 23 Jan 2003 14:55:56 +0000 Subject: [PATCH] [project @ 2003-01-23 14:55:56 by simonpj] Refine documentation of newtype-deriving stuff --- ghc/docs/users_guide/glasgow_exts.sgml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) 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) -- 1.7.10.4