From 32c4b4b2e71ab2f44a567addefb40f3d4b0fecb8 Mon Sep 17 00:00:00 2001 From: simonpj Date: Tue, 16 Dec 2003 16:18:08 +0000 Subject: [PATCH] [project @ 2003-12-16 16:18:08 by simonpj] Clarify newtype deriving documentation --- ghc/docs/users_guide/glasgow_exts.sgml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index 2a7f379..db91ac0 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -1597,9 +1597,9 @@ declarations instance context2 => C type2 where ... +"overlap" if type1 and type2 unify. -"overlap" if type1 and type2 unify - + However, if you give the command line option -fallow-overlapping-instances option then overlapping instance declarations are permitted. @@ -3105,17 +3105,24 @@ where S is a type constructor, - t1...tk are types, + The t1...tk are types, - vk+1...vn are type variables which do not occur in any of + The vk+1...vn are type variables which do not occur in any of the ti, and - the ci are partial applications of + 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. + + None of the ci is Read, Show, + Typeable, or Data. These classes + should not "look through" the type or its constructor. You can still + derive these classes for a newtype, but it happens in the usual way, not + via this new mechanism. + Then, for each ci, the derived instance declaration is: -- 1.7.10.4