Commit 0f965da5 authored by simonpj's avatar simonpj
Browse files

[project @ 2005-12-16 15:17:29 by simonpj]

Document that type variables in instance context must be distinct; merge to stable
parent 4dd415e9
......@@ -1866,16 +1866,21 @@ For example, this is OK:
<para>All of the types in the <emphasis>context</emphasis> of
an instance declaration <emphasis>must</emphasis> be type variables.
an instance declaration <emphasis>must</emphasis> be type variables, and
there must be no repeated type variables in any one constraint.
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 <literal>Int</literal> in the context), and nor is
instance C b b => Foo [b] where ...
(because of the repeated type variable).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment