i am learning Haskell from learnyouhaskell.com and got this error message when compiling my program.
Error:
baby.hs:25:26: error:
parse error on input `='
Perhaps you need a 'let' in a 'do' block?
e.g. 'let x = 5' instead of 'x = 5'
Code:
bump :: [String] -> IO ()
bump [fileName, numberString] = do
handle <- openFile fileName ReadMode
(tempName, tempHandle) <- openTempFile "." "temp"
contents <- hGetContents handle
let number = read numberString
text = lines contents
bumpLine = text !! number
newText = delete (text !! number) text
hPutStr tempHandle $ unlines (bumpLine:newText)
hClose handle
hClose tempHandle
removeFile fileName
renameFile tempName fileName
Can anyone help me with this?