How overload operator in Haskell?

Graham Klyne GK@ninebynine.org
Fri, 11 Jul 2003 12:22:46 +0100


At 23:07 10/07/03 -0700, Ashley Yakeley wrote:
>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.

It's true of strict Haskell 98 (see report, section 4.3.2), but I think the 
condition is relaxed in GHC.

#g


-------------------
Graham Klyne
<GK@NineByNine.org>
PGP: 0FAA 69FF C083 000B A2E9  A131 01B9 1C7A DBCA CB5E