TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

The Haskell Phrasebook (2019)

104 pointsby bshanksalmost 4 years ago

5 comments

exdsqalmost 4 years ago
This is a great way to teach Haskell! The authors taught beginners at Zurihac 2020 and were great at explaining the &#x27;harder&#x27; concepts like monads too<p>Edit: by the way, if you&#x27;re wanting to learn or struggling to learn monads, you can&#x27;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.
评论 #27729019 未加载
评论 #27730151 未加载
ex3xualmost 4 years ago
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&#x2F;conceptual overviews for many other languages as well.<p>For the same target audience looking for free introductory coursework&#x2F;exercises for Haskell, I&#x27;d recommend working through the Data61 Haskell course [3]. Brian McKenna has a nice Youtube series [4] covering it.<p>[0] <a href="https:&#x2F;&#x2F;gobyexample.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;gobyexample.com&#x2F;</a><p>[1] <a href="https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;rust-by-example&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;rust-by-example&#x2F;index.html</a><p>[2] <a href="https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;learnxinyminutes.com&#x2F;</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;system-f&#x2F;fp-course#readme" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;system-f&#x2F;fp-course#readme</a><p>[4] <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=NzIZzvbplSM" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=NzIZzvbplSM</a>
nine_kalmost 4 years ago
It&#x27;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 &quot;variables&quot;, first, immutability and monads that power them much later.
评论 #27729525 未加载
tremonalmost 4 years ago
From the &quot;defining functions&quot; example (<a href="https:&#x2F;&#x2F;typeclasses.com&#x2F;phrasebook&#x2F;defining-functions" rel="nofollow">https:&#x2F;&#x2F;typeclasses.com&#x2F;phrasebook&#x2F;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&#x27;t a state, so both `next x` evaluate to the same value)
评论 #27729457 未加载
评论 #27729657 未加载
Vosporosalmost 4 years ago
Absolutely brilliant content