[String] -> [[Bool]]

tahara@swj.co.jp tahara@swj.co.jp
Wed, 13 Aug 2003 17:29:01 +0900


> i am new wif haskell, i would like to know how can i get a list of string and
> convert it to a list of a list of bool
> 
> [String]-> [[Bool]]
> 
> for example a [String].... ["0 1 0 1 0 1","0 0 0 0 0 0 ","1 0 0 0 1 0"]
> 
> it return true if 0 and false if 1. the [String] is read from a
> file.

map (\x -> map (=="0") x) $ map words ["0 1 0 1 0 1","0 0 0 0 0 0 ","1 0 0 0 1 0"]
--
Yoshinori Tahara <tahara@swj.co.jp>