The Haskell Phrasebook (2019)
typeclasses.com
typeclasses.com
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.
[1] https://fsharpforfunandprofit.com/rop/ [2] https://fsharpforfunandprofit.com/posts/elevated-world/
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.
[1] https://doc.rust-lang.org/rust-by-example/index.html
[2] https://learnxinyminutes.com/
It starts with stuff that makes Haskell look like an unimposing imperative language, like Python.
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.
greetNext x = (next x, greet (show (next x)))
Is this actually valid, unambiguous code? What determines which `next x` gets evaluated first?(edit: oh, nvm, x isn't a state, so both `next x` evaluate to the same value)
Yes. More generally, Haskell functions are pure (side-effect free), so you always expect the same input value to result in the same output.
I wish they had run more novices through these phrases.