Skip to content

Instantly share code, notes, and snippets.

@xrl
Created April 22, 2011 05:56
Show Gist options
  • Save xrl/936132 to your computer and use it in GitHub Desktop.
Save xrl/936132 to your computer and use it in GitHub Desktop.
bad code
removeNewLines = filter (/= '\n')
applyToFile filename = do
contents <- readFile filename
return (removeNewLines contents)
main :: IO ()
main = do
putStrLn (applyToFile "prob7.txt")
=================
Couldn't match expected type `[Char]' with actual type `IO [Char]'
Expected type: String
Actual type: IO [Char]
In the return type of a call of `applyToFile'
In the first argument of `putStrLn', namely
`(applyToFile "prob7.txt")'
make: *** [prob7.o] Error 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment