I was reading this answer and asked some people why "main" is used two times with different punctuation in front.
main :: IO ()
main = do c <- getChar
putChar c
The answer was that the first line declares the type and the second line declares the function. My doubt is, why do we have to say the type before the definition? Wouldn't the type be implied by the definition and syntax?
main
, but a big program has a lot of function with a lot of different types) $\endgroup$