The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

24997 (12) [Avatar] Offline
#1
in paragraph 0.4, listing 0.2 we see:

messyMain :: IO()

I supposed that's the equivalent of an import declaration in other languages but I couldn't fin any reference/explanation in the chapters about Types.

Could you shine a little light? and myabe add something in the book about import libraries, if it's not anywhere yet?

Thanks

Will Kurt (21) [Avatar] Offline
#2
That part is actually the type signature of the function. I probably should make a note of that in the book smilie Type signatures are discussed heavily in Unit 2 and the IO () type in Unit 4. We do discuss imports in Unit 1 (I believe) and it is explained more clearly there. Most of Unit 0 is to just give you a sense of what Haskell code looks like, it's perfectly okay if not everything is clear. In Unit 1 we start setting the foundation for functional programming in Haskell.

Thanks for your question!