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> </DIV>
<DIV>addPoly::Poly->Poly->Poly<BR>addPoly x y =3D zipWith (+) x =
y</DIV>
<DIV> </DIV>
<DIV>instance (Float a) =3D> Num (Poly a)=20
where<BR> &nbs=
p; =20
x + y =3D addPoly x y</DIV>
<DIV> </DIV>
<DIV> </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> </DIV>
<DIV>Cheers</DIV>
<DIV> </DIV>
<DIV>Benny</DIV></BODY></HTML>
------=_NextPart_000_0013_01C1E3D0.4EA4A400--