I am using a String -> IO [x]
function in order to read in the contents of a file into a list where each element in the list is a word from the file.
However, I would like to use the the [x]
list as an input for another function. My issue is that I do not understand how to access the basic [x]
list rather than the IO [x]
list generated in my initial function. I have been getting around this for testing by using GHCI and using
k <- listRead "file.txt"
and then using that k
as input in my next function that only takes a list [x]
as input.
How can I use the "internal" list [x]
instead of the returned IO [x]
that my initial function returns?