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.

Learn Haskell by building a blog generator – a project-oriented Haskell book

230 pointsby gilmialmost 3 years ago

11 comments

cosmic_quantaalmost 3 years ago
That&#x27;s the perfect learning project because there&#x27;s something tangible at the end.<p>Whenever the question of &quot;How do I learn Haskell&quot; comes up, I always suggest to come up with a project that would be useful on its own, regardless of the technology used to create it, and use Haskell to do it. In my case it was a pandoc filter to embed plots in documents (<a href="https:&#x2F;&#x2F;github.com&#x2F;LaurentRDC&#x2F;pandoc-plot" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;LaurentRDC&#x2F;pandoc-plot</a>), which was ultimately useful to create my PhD dissertation.<p>There&#x27;s only so much you can learn about Haskell by working through toy examples.
评论 #31666673 未加载
_queryalmost 3 years ago
If you want to do web development with Haskell beyond building a blog generator, a good starting point is IHP (<a href="https:&#x2F;&#x2F;ihp.digitallyinduced.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ihp.digitallyinduced.com&#x2F;</a> <a href="https:&#x2F;&#x2F;github.com&#x2F;digitallyinduced&#x2F;ihp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;digitallyinduced&#x2F;ihp</a>). IHP is Haskell&#x27;s version of Laravel&#x2F;Rails&#x2F;Django. It&#x27;s really a superpower to have Haskell&#x27;s type system combined with the rapid development approach of Rails :) (Disclaimer: I&#x27;m founder of the company that makes IHP)
评论 #31669757 未加载
评论 #31665446 未加载
评论 #31666566 未加载
评论 #31667943 未加载
matijashalmost 3 years ago
This is really cool! I&#x27;ve been looking for something like for a while - my learning path was through LYAH and Real-World Haskell (also tried Haskell from the first principles but a bit too extensive IMO). I think this would fit in perfectly between LYAH and RWH.<p>I am using Haskell mostly for writing compilers (<a href="https:&#x2F;&#x2F;github.com&#x2F;wasp-lang&#x2F;wasp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;wasp-lang&#x2F;wasp</a> currently), but I believe if the tutorial isn&#x27;t using a lot of specialized libraries&#x2F;frameworks (which seems to be the case from the first glance), a majority of the material taught should be transferable to any domain.
评论 #31680499 未加载
bwanabalmost 3 years ago
If you’re more inclined to visual and&#x2F;or musical arts, I’d recommend “Th Haskell School Of Expression” by Paul Hudak. He guides you through the language and the techniques with an eye for concise, expressive code that has good runtime characteristics.
mbrodersenalmost 3 years ago
Kudos to the author. The best way to teach something is to start with a foundation of nothing and then step by step building layers of understanding on top of it. Most other Haskell tutorials fail to do this.
评论 #31680494 未加载
Iceland_jackalmost 3 years ago
Oh this looks fun getStructureString and render can be defined as record selectors<p><pre><code> newtype Structure = Structure { getStructureString :: String } newtype Html = Html { render :: String } </code></pre> BlockArguments let you write expressions like myhtml<p><pre><code> myhtml :: Html myhtml = html_ &quot;My title&quot; ( append_ (h1_ &quot;Heading&quot;) ( append_ (p_ &quot;Paragraph #1&quot;) (p_ &quot;Paragraph #2&quot;) ) ) </code></pre> in a more domain-specific style. De gustibus, but some may prefer it to the parentheses.<p><pre><code> {-# Language BlockArguments #-} myhtml :: Html myhtml = html_ &quot;My title&quot; do append_ do h1_ &quot;Heading&quot; do append_ do p_ &quot;Paragraph #1&quot; do p_ &quot;Paragraph #2&quot; </code></pre> or using the associativity of append_ = (&lt;&gt;)<p><pre><code> myhtml = html_ &quot;My title&quot; do h1_ &quot;Heading&quot; &lt;&gt; p_ &quot;Paragraph #1&quot; &lt;&gt; p_ &quot;Paragraph #2&quot; myhtml = html_ &quot;My title&quot; do mconcat [ h1_ &quot;Heading&quot; , p_ &quot;Paragraph #1&quot; , p_ &quot;Paragraph #2&quot; ] </code></pre> All examples of &#x27;concat . map&#x27; can be replaced with.. concatMap :Ð
评论 #31667079 未加载
zeckalphaalmost 3 years ago
I have found Hakyll to be useful in this space, if you want to move from building your own to configuring&#x2F;extending your own.
hans1729almost 3 years ago
At first sight I’ve read “an object-oriented Haskell book”.<p><i>[brief pause for contemplating the thought]</i><p>Naturally, someone went there: <a href="https:&#x2F;&#x2F;www.parsonsmatt.org&#x2F;tutorials&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.parsonsmatt.org&#x2F;tutorials&#x2F;</a>
评论 #31666521 未加载
danukeralmost 3 years ago
How you would write tests in a real project?<p>I suppose it&#x27;s not writing out the entire program and then writing the tests, as seems to be implied. That would mean a lot of manual testing.<p>Or is there a Haskell REPL where you can try out small pieces before saving them?
评论 #31664955 未加载
评论 #31669870 未加载
评论 #31664940 未加载
评论 #31664825 未加载
评论 #31665057 未加载
ypeterholmesalmost 3 years ago
For anyone that does decide to learn Haskell, you can easily get a job afterwards working on the Cardano blockchain. Smart contract devs are in high demand, and Cardano uses a variant of Haskell that is relatively unique to the space.
评论 #31703445 未加载
alephnanalmost 3 years ago
Is the website&#x2F;book&#x2F;blog self-hosting?<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Self-hosting_(compilers)" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Self-hosting_(compilers)</a>
评论 #31664961 未加载