This is a great way to teach Haskell! The authors taught beginners at Zurihac 2020 and were great at explaining the 'harder' concepts like monads too<p>Edit: by the way, if you're wanting to learn or struggling to learn monads, you can't go wrong reading the literature at the time. Seeing how Haskell originally used types and pattern matching to IO and how hard it was to do things like logging, and then how monads fix that, is the absolute best way to approach the subject. SPJ and Wadler are the authors of those papers.
Pretty cool. They note that they are inspired by <i>Go by Example</i> [0] and <i>Rust by Example</i> [1], and this book seems stylistically similar to the community-driven Learn X in Y minutes site [2] which covers quick syntax/conceptual overviews for many other languages as well.<p>For the same target audience looking for free introductory coursework/exercises for Haskell, I'd recommend working through the Data61 Haskell course [3]. Brian McKenna has a nice Youtube series [4] covering it.<p>[0] <a href="https://gobyexample.com/" rel="nofollow">https://gobyexample.com/</a><p>[1] <a href="https://doc.rust-lang.org/rust-by-example/index.html" rel="nofollow">https://doc.rust-lang.org/rust-by-example/index.html</a><p>[2] <a href="https://learnxinyminutes.com/" rel="nofollow">https://learnxinyminutes.com/</a><p>[3] <a href="https://github.com/system-f/fp-course#readme" rel="nofollow">https://github.com/system-f/fp-course#readme</a><p>[4] <a href="https://www.youtube.com/watch?v=NzIZzvbplSM" rel="nofollow">https://www.youtube.com/watch?v=NzIZzvbplSM</a>
It's fun.<p>It starts with stuff that makes Haskell look like an unimposing imperative language, like Python.<p>It may be a good idea for the introduction: instead of presenting the wall of ideas that make Haskell interesting and unusual, first offer the do-notation that makes Haskell feel familiar, and make the reader feel confident quickly. Introduce "variables", first, immutability and monads that power them much later.
From the "defining functions" example (<a href="https://typeclasses.com/phrasebook/defining-functions" rel="nofollow">https://typeclasses.com/phrasebook/defining-functions</a>):<p><pre><code> greetNext x = (next x, greet (show (next x)))
</code></pre>
Is this actually valid, unambiguous code? What determines which `next x` gets evaluated first?<p>(edit: oh, nvm, x isn't a state, so both `next x` evaluate to the same value)