I'm trying to write an IO program that reverses text, but it just can't work. I've tried to adjust the indention of reverse function, still, it didn't work.
The full error message is :
reverse.hs:11:1: parse error (possibly incorrect indentation or mismatched brackets)
--reverse a file
module Main where
import System.IO
main = do
putStrLn "reading a file..."
theInput <- readFile "input.txt"
writeFile "output.txt" $ reverse` theInput
reverse` :: String -> String
reverse` [] = []
reverse` (_:xs) = reverse xs : _