4 ms·
The Haskell Phrasebook (2019)
- nine_k 5y agoIt's fun. 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.
- amelius 5y agoYeah but if you make a small mistake you'll quickly be confronted with the underlying mechanics anyway, in the form of an inexplicable error message.
- ex3xu 5y agoPretty cool. They note that they are inspired by Go by Example [0] and Rust by Example [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. 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. [0] https://gobyexample.com/ https://gobyexample.com/ [1] https://doc.rust-lang.org/rust-by-example/index.html https://doc.rust-lang.org/rust-by-example/index.html [2] https://learnxinyminutes.com/ https://learnxinyminutes.com/ [3] https://github.com/system-f/fp-course#readme https://github.com/system-f/fp-course#readme [4] https://www.youtube.com/watch?v=NzIZzvbplSM https://www.youtube.com/watch?v=NzIZzvbplSM
- exdsq 5y agoThis 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 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.
- lkuty 5y agoTalking about monads, I found Railway Oriented Programming [1] and "Understanding map and apply" [2] (and the whole serie) really interesting. I liked the notion of lifting types to an "elevated world". [1] https://fsharpforfunandprofit.com/rop/ https://fsharpforfunandprofit.com/rop/ [2] https://fsharpforfunandprofit.com/posts/elevated-world/ https://fsharpforfunandprofit.com/posts/elevated-world/
- exdsq 5y agoYeah I agree!
- aaronchall 5y agoCould someone link us to that literature?
- exdsq 5y agoTackling the Awkward Squad by SPJ is a good starting point, it'll link to the other literature
- Vosporos 5y agoAbsolutely brilliant content
- tremon 5y agoFrom the "defining functions" example (https://typeclasses.com/phrasebook/defining-functions https://typeclasses.com/phrasebook/defining-functions): 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)
- fn-mote 5y ago> 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.
- rout39574 5y agoAnd they first explain "show" in the following passage. I wish they had run more novices through these phrases.