As a beginner, i wrote a snippet to flip a string's case.
module Main
where
import Data.Char
main=do
str<-getLine
putStrLn ( reverser(str) )
reverser:: String -> String
reverser [] = []
reverser (x:xs) | isUpper x = toLower x : reverser xs
| otherwise = toUpper x : reverser xs
And it worked perfectly on the hackerearth.com's IDE
However,when I tried running the same on my machine, the code is executing endlessly and not coming up with any output nor error.
What am I doing wrong?