Many times it happens that while I try to compile an .hs
file, the Emacs 23 Haskell mode goes into an unending process and does not show any response. The only thing that happens is that the cursor turns into a circle and within the circle the dots start circling.
What is the best approach to avoid this situation? If I get into this situation, how can I get out? At present, I restart my computer. Please guide.
Recently, it happened for the following code:
import Control.Monad
import Data.Char
main = do
putStrLn "This is an addition"
contents <- getContents
putStrLn $ (shortLinesOnly contents)
shortLinesOnly :: String -> String
shortLinesOnly input =
allLines = lines input
shortLines = filter (\line -> length line < 10) allLines
res = unlines shortLines
in result