logo       

Re: no non-typevariable in instance declarations: msg#00055

lang.haskell.general

Subject: Re: no non-typevariable in instance declarations

Tue, 14 Nov 2000 16:17:48 -0200, José Romildo Malaquias
<romildo@xxxxxxxxxxxxxxxxxx> pisze:

> But this is not relevant to my question. Removing the instance
> declaration
>
> instance C Integer where
> ty _ = "Integer"
>
> from the program (so that there is no instance overlapping now)
> does not help.

In this case your instance would be the only one possible (any other
would overlap) and it could be equally well written as a plain function.

Actually Haskell 98 has more severe restriction than non-overlapping
instances. The instance head must be a type constructor applied to
as many distinct type variables as needed to let the kinds match.
"instance Foo [Int]" is as non-standard as "instance Foo a".

--
__("< Marcin Kowalczyk * qrczak@xxxxxxxxxx http://qrczak.ids.net.pl/
\__/
^^ SYGNATURA ZASTÊPCZA
QRCZAK





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise