
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

"Tn X-10n"
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]]
What is the definition of a String? (I.e. what is a String a list of?) Write a function to convert one of these to the corresponding Bool. Then write a function that uses that function to convert a String to a list of Bool. And then, in a similar manner, apply it to a list of Strings to generate a list of lists of Bool. -kzm -- If I haven't seen further, it is by standing in the footprints of giants
participants (3)
-
ketil@ii.uib.no
-
tahara@swj.co.jp
-
Tn X-10n