list comprehension
Stephanie Randles
Stephanie Randles" <srandles@bigpond.net.au
Fri, 19 Oct 2001 19:15:12 +1000
This is a multi-part message in MIME format.
------=_NextPart_000_004C_01C158D2.6126E540
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,=20
I have a script here
interleave :: [Integer] -> [Strings] -> [String]
interleave (x:xs) (y:ys)
=3D words [a | a <- (unwords [(show x), (filter (/=3D 1) y), =
"+"])] =20
and the error message i receive is=20
(Instance of Num Char required for definition of interleave)
and I don't understand what this is asking of me.
Please help if you are able to!!!
Thanks.....Steph
------=_NextPart_000_004C_01C158D2.6126E540
Content-Type: text/html;
charset="iso-8859-1"
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=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi, </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>I have a script here</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>interleave :: [Integer] -> =
[Strings]=20
-> [String]<BR>interleave (x:xs)=20
(y:ys)<BR> =3D words [a | a =
<-=20
(unwords [(show x), (filter (/=3D 1) y), "+"])] =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>and the error message i receive is =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>(Instance of Num Char required for =
definition of=20
interleave)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>and I don't understand what this is =
asking of=20
me.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Please help if you are able =
to!!!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial =
size=3D2>Thanks.....Steph</FONT></DIV></BODY></HTML>
------=_NextPart_000_004C_01C158D2.6126E540--