[String]-[[Bool]] 2

2003-08-14 Thread Tn X-10n

[String] contains = ["1 0 0","1 0 0","0 1 0"] this [String] is read from a file.
the file shows only: i convert it by using Lines. but i stuck wif the output.
1 0 0
1 0 0
1 0 1
if 1 then False 0 then True
the expected result show be [[False,True,True],[False,True,True],[True,False,True]]

My code is as followed...
 readF :: String - IO () readF fname = do x - (readFile fname) putStr (show(conv(words x))) i can't use lines here because change only accepts "0" or "1". but my file contains spaces.
 change :: String - Bool change "1" = True change "0" = False
 conv :: [String] - [Bool]==unable to declare [[Bool]] conv fname = [(change x)| x - (fname)]
Get free gift vouchers every week with MSN Premium Vouchers
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [String]-[[Bool]] 2

2003-08-14 Thread Ketil Z. Malde
Tn X-10n [EMAIL PROTECTED] writes:

 change :: String - Bool
 change 1  = True
 change 0  = False

  conv :: [String] - [Bool]==unable to declare [[Bool]]

Again: a String is a list of ?

-kzm
-- 
If I haven't seen further, it is by standing in the footprints of giants
___
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe