[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

Reply via email to