[Haskell-beginners] Parsing a file

Roger Mason rmason at mun.ca
Thu Jan 27 12:21:01 UTC 2022


Hello Francesco,

Thanks for your help.

Francesco Ariis <fa-ml at ariis.it> writes:

>
> Simple quiz: do you understand why
>
>     main :: IO ()
>     main = "prova"
>

That returns a String rather than an "IO something".

> does nor work (nor compile) while
>
>     main :: IO ()
>     main = putStrLn "prova"
>
> does?

putStrLn returns an "IO something" and so is campatible with the type of
main.

Thank you for the help & encouragement.

Roger


More information about the Beginners mailing list