If you use parentheses in your do expression, you must use semicolons. In addition, the last line should be putStrLn $ "The num is:" ++ show (read number :: Int)
So, you have two options:
main = do { putStrLn "Please enter the number"; number <- getLine; putStrLn $ "The num is:" ++ show (read number:: Int) }
or
main = do putStrLn "Please enter the number" number <- getLine putStrLn $ "The num is:" ++ show (read number:: Int)
Almost all the code I saw uses the second version, but they are both valid. Please note that in the second version, spaces become significant.
source share