Help need "Cannot use type synonym in instance head"

Benny neon_2001@hotmail.com
Sun, 14 Apr 2002 16:22:36 +1200


This is a multi-part message in MIME format.

------=_NextPart_000_0007_01C1E3D0.96AB5C80
Content-Type: text/plain;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

type Poly =3D [Float]

addPoly::Poly->Poly->Poly
addPoly x y =3D zipWith (+) x y

instance (Float a) =3D> Num (Poly a) where
               (+) =3D addPoly


I got the error message "Cannot use type synonym in instance head" when =
I was trying to compile the codes above. Can anyone tell me why and how =
to solve it?

Cheers

 Benny

------=_NextPart_000_0007_01C1E3D0.96AB5C80
Content-Type: text/html;
	charset="big5"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dbig5">
<META content=3D"MSHTML 5.50.4134.100" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DMingLiu size=3D2>type Poly =3D [Float]</FONT></DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu =
size=3D2>addPoly::Poly-&gt;Poly-&gt;Poly<BR>addPoly x y =3D=20
zipWith (+) x y</FONT></DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu size=3D2>instance (Float a) =3D&gt; Num (Poly =
a)=20
where<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;=20
(+) =3D addPoly</FONT></DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DMingLiu size=3D2>I got the error message "Cannot use =
type synonym=20
in instance head" when I was trying to compile the codes above. Can =
anyone tell=20
me why and how to solve it?</FONT></DIV>
<DIV><FONT face=3D=B2=D3=A9=FA=C5=E9 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D=B2=D3=A9=FA=C5=E9 size=3D2>Cheers</FONT></DIV>
<DIV><FONT face=3D=B2=D3=A9=FA=C5=E9 size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D=B2=D3=A9=FA=C5=E9 =
size=3D2>&nbsp;Benny</FONT></DIV></BODY></HTML>

------=_NextPart_000_0007_01C1E3D0.96AB5C80--