help need

Benny neon_2001@hotmail.com
Sun, 14 Apr 2002 16:20:35 +1200


This is a multi-part message in MIME format.

------=_NextPart_000_0013_01C1E3D0.4EA4A400
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
                   x + y =3D addPoly x y


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

Cheers

Benny

------=_NextPart_000_0013_01C1E3D0.4EA4A400
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>type Poly =3D [Float]</DIV>
<DIV>&nbsp;</DIV>
<DIV>addPoly::Poly-&gt;Poly-&gt;Poly<BR>addPoly x y =3D zipWith (+) x =
y</DIV>
<DIV>&nbsp;</DIV>
<DIV>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;&nbsp;&nbsp;&nbsp;&nbsp;=20
x + y&nbsp;=3D addPoly x y</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV>I got the "Cannot use type synonym in instance head" error message =
when I=20
was trying to compile the above code. Can you tell me why and how to =
solve=20
it?</DIV>
<DIV>&nbsp;</DIV>
<DIV>Cheers</DIV>
<DIV>&nbsp;</DIV>
<DIV>Benny</DIV></BODY></HTML>

------=_NextPart_000_0013_01C1E3D0.4EA4A400--