fre 2003-07-11 klockan 08.07 skrev Ashley Yakeley:
In article <16140.55249.147965.603167@cerise.nosuchdomain.co.uk>, Glynn Clements <glynn.clements@virgin.net> wrote:
instance Num Vector where
Except that class instances have to be algebraic datatypes ("data") or renamed datatypes ("newtype"), but not type synonyms ("type").
That's not true, is it? I mean as long as there isn't already some overlapping instance, I think it's quite OK.
Well, there's the "The instance type must be of form (T a b c) where T is not a synonym, and a,b,c are distinct type variables" restriction (ghc), or as hugs put it: "Cannot use type synonym in instance head" You get around it with hugs -98 or ghc -fglasgow-exts. Dunno about nhc98. /Martin NB: I just used class Foo ; instance Foo String to produce these error messages... -- Martin Sjögren martin@strakt.com Phone: +46 (0)31 7490880 Cell: +46 (0)739 169191 GPG key: http://www.strakt.com/~martin/gpg.html