How to get the String out of the IO String in Haskell

Answer: With <- You get the String out of the IO String with <- . Example in GHCI You have getLine :: IO String and you want to get the String . You can't "just" let line = getLine :: String because then you'll see: <interactive>:3:12: error: [GHC-83865] • Couldn't match type: IO String with: [Char] Expected: String Actual: IO String • In the expression: getLine :: String In an equation for…