
Hi Gilmara,
I assume you are trying to do this:
main = do
map sort $ learquivo "dataFile.txt"
which gives you the error you mention. The problem is you are trying to use a
"IO [[Int]]" where you want a "[[Int]]". To data out of IO, you must use the
"<-" operator. To write a program which reads a line from the user and echos it
back you do this:
main = do
userLine <- readLine
putStrLn userLine
The type of userLine is "String" (or "[Char]" if you prefer).
Similarly, to change your "IO [[Int]]" to an [[Int]] you need to use the <-
operator.
So your program could become:
main = do
intListOfLists <- learquivo "dataFile.txt"
let sortedSubLists = map Data.List.sort intListOfLists
.....
Does this help? If not, read the "True Nature of Return" section of Real World
Haskell: http://book.realworldhaskell.org/read/io.html#io.return
Hope this helps,
Tim
----- Original Message ----
From: Gilmara Pompelli