I\'m trying to convert IO [String] to [String] with <- binding; however, I need to use a do block to
You cannot convert for IO String to a String.
What you can do, however, is bind the contents of IO String to a 'variable', but that will still result in the whole computation being embedded inside IO.
foo = do
x <- baz -- here baz is the IO String
let x' = doStuff x
return x' -- embeds the String inside IO, as otherwise the computation would result in IO ()
To answer your question
foo x = baz x -- x here is your 'IO String'
where
baz x = do
x' <- x
return $ doStuff x'