That's the perfect learning project because there's something tangible at the end.<p>Whenever the question of "How do I learn Haskell" 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://github.com/LaurentRDC/pandoc-plot" rel="nofollow">https://github.com/LaurentRDC/pandoc-plot</a>), which was ultimately useful to create my PhD dissertation.<p>There's only so much you can learn about Haskell by working through toy examples.
If you want to do web development with Haskell beyond building a blog generator, a good starting point is IHP (<a href="https://ihp.digitallyinduced.com/" rel="nofollow">https://ihp.digitallyinduced.com/</a> <a href="https://github.com/digitallyinduced/ihp" rel="nofollow">https://github.com/digitallyinduced/ihp</a>). IHP is Haskell's version of Laravel/Rails/Django. It's really a superpower to have Haskell's type system combined with the rapid development approach of Rails :) (Disclaimer: I'm founder of the company that makes IHP)
This is really cool! I'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://github.com/wasp-lang/wasp" rel="nofollow">https://github.com/wasp-lang/wasp</a> currently), but I believe if the tutorial isn't using a lot of specialized libraries/frameworks (which seems to be the case from the first glance), a majority of the material taught should be transferable to any domain.
If you’re more inclined to visual and/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.
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.
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_
"My title"
( append_
(h1_ "Heading")
( append_
(p_ "Paragraph #1")
(p_ "Paragraph #2")
)
)
</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_ "My title" do
append_
do h1_ "Heading"
do append_
do p_ "Paragraph #1"
do p_ "Paragraph #2"
</code></pre>
or using the associativity of append_ = (<>)<p><pre><code> myhtml =
html_ "My title" do
h1_ "Heading" <> p_ "Paragraph #1" <> p_ "Paragraph #2"
myhtml =
html_ "My title" do mconcat
[ h1_ "Heading"
, p_ "Paragraph #1"
, p_ "Paragraph #2"
]
</code></pre>
All examples of 'concat . map' can be replaced with.. concatMap :Ð
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://www.parsonsmatt.org/tutorials/" rel="nofollow">https://www.parsonsmatt.org/tutorials/</a>
How you would write tests in a real project?<p>I suppose it'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?
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.
Is the website/book/blog self-hosting?<p><a href="https://en.wikipedia.org/wiki/Self-hosting_(compilers)" rel="nofollow">https://en.wikipedia.org/wiki/Self-hosting_(compilers)</a>