[String]->[[Bool]] 2

Tn X-10n kawairashii@hotmail.com
Wed, 13 Aug 2003 16:44:50 +0800

<html><div style='background-color:'><DIV>
<P>[String] contains =&nbsp; ["1 0 0&nbsp;","1 0 0","0 1 0"] this [String] is read from a file.</P>
<P>the file shows only: i convert it by using Lines. but i stuck wif the output.&nbsp;</P>
<P>1 0 0</P>
<P>1 0 0</P>
<P>1 0 1<BR></P>
<P>if&nbsp; 1 then False 0 then True</P>
<P>the expected result show be [[False,True,True],[False,True,True],[True,False,True]]</P>
<P>My code is as followed...</P>
<P>&gt; readF :: String -&gt; IO ()<BR>&gt; readF fname = do x &lt;- (readFile fname)<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; putStr (show(conv(words x))) ------------i can't use lines here because change only accepts "0" or "1". but my file contains spaces.</P>
<P>&gt; change :: String -&gt; Bool<BR>&gt; change "1"&nbsp; = True<BR>&gt; change "0"&nbsp; = False<BR></P>
<P>&gt; conv :: [String] -&gt; [Bool]======================unable to declare [[Bool]]<BR>&gt; conv fname = [(change x)| x &lt;- (fname)]<BR></P>
<P><BR>&nbsp;</P></DIV></div><br clear=all><hr>Get <a href="http://g.msn.com/8HMYENSG/2731??PS=">free gift vouchers every week</a> with MSN Premium Vouchers</html>