From 0f965da50e02edda7cd4e441dfdc379ba77f5d98 Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 16 Dec 2005 15:17:29 +0000 Subject: [PATCH] [project @ 2005-12-16 15:17:29 by simonpj] Document that type variables in instance context must be distinct; merge to stable --- ghc/docs/users_guide/glasgow_exts.xml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ghc/docs/users_guide/glasgow_exts.xml b/ghc/docs/users_guide/glasgow_exts.xml index 620f8b6..1e0e5b9 100644 --- a/ghc/docs/users_guide/glasgow_exts.xml +++ b/ghc/docs/users_guide/glasgow_exts.xml @@ -1866,16 +1866,21 @@ For example, this is OK: All of the types in the context of -an instance declaration must be type variables. +an instance declaration must be type variables, and +there must be no repeated type variables in any one constraint. Thus instance C a b => Eq (a,b) where ... is OK, but -instance C Int b => Foo b where ... +instance C Int b => Foo [b] where ... -is not OK. +is not OK (because of the non-type-variable Int in the context), and nor is + +instance C b b => Foo [b] where ... + +(because of the repeated type variable). -- 1.7.10.4