From: simonpj Date: Fri, 16 Dec 2005 15:17:29 +0000 (+0000) Subject: [project @ 2005-12-16 15:17:29 by simonpj] X-Git-Tag: final_switch_to_darcs,_this_repo_is_now_live~85 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=0f965da50e02edda7cd4e441dfdc379ba77f5d98;p=ghc-hetmet.git [project @ 2005-12-16 15:17:29 by simonpj] Document that type variables in instance context must be distinct; merge to stable --- 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).