
On Wed, Sep 8, 2010 at 10:31 AM, Lorenzo Isella
in the interactive shell and get a string, but I am having problems in converting this to a list or anything more manageable (where every entry is an integer number i.e. something which can be summed, subtracted etc...). Ideally even a list where every entry is a row (a list in itself) would do.
Well, first of all you can split your input into lists using lines :: String -> [String] Then, you can split each line into columns by using words :: String -> [String] Now, on each of these columns you can convert to an integer by using: read :: Read a => String -> a So in the end, you'll end up with something of type [[Int]]. Does this help you to go into the right direction? Cheers! =) PS: Yes, that link's information sort of applies, but you'll be handling lists of lists (i.e. rows of columns). -- Felipe.