I am writing my first Haskell program that reads input. getLine has type IO String, and my function wordCount :: String -> Int wants a String, so wordCount getLine is rejected by the type checker. I have looked for a function of type IO String -> String and cannot find one.
How do I use the result of an IO action in ordinary code, and why is it designed this way?




