That's the perfect learning project because there's something tangible at the end.
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 (https://github.com/LaurentRDC/pandoc-plot), which was ultimately useful to create my PhD dissertation.
There's only so much you can learn about Haskell by working through toy examples.
Great project; I'd have loved to have had it when I was writing my dissertation - hell, I'd have liked anything that would have let me write it in vim and just generate the final submission per the university's format, because I hate Word.
If you want to do web development with Haskell beyond building a blog generator, a good starting point is IHP (https://ihp.digitallyinduced.com/https://github.com/digitallyinduced/ihp). 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)
I think IHP for learning Haskell has the same flaw that Rails always did. You have no idea what is part of the language and what is part of the framework. You'll get stuck once you stray from the golden path.
I'd recommend starting with Scotty instead. It's much easier to understand what it is doing. Use Lucid for HTML rendering, and your choice of DB libraries (I like Selda). These all avoid template haskell and don't rename any prelude functions. If you add them one at a time you'll see what each one is offering and understand where to go when you need to do something more complicated
Mysql support is not implemented at the moment. If there's someone paying for the development we could have it. You're of course also free to contribute it yourself to the open source version, then it wouldn't need to be part of the commercial version.
Not OP, but it sounds like MySQL support isn't out yet. So I think the business plan can help them get paid to implement it. No clue if that means the FOSS version would receive those upstream changes once it's done.
Ah, I was wondering why you post about IHP on most Haskell threads here and I just noticed it is a commercial product. You should probably disclose that this is an advertisement if it is permitted at all.
I comment on most Haskell threads about IHP because I would love to see more Haskell adoption. Most people think Haskell is about Monads and Math, with IHP we want to show that Haskell can be used in a very productive way to build things. The comments are typically well received, so I don't see any problem with this.
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.
I am using Haskell mostly for writing compilers (https://github.com/wasp-lang/wasp 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.
in a more domain-specific style. De gustibus, but some may prefer it to the parentheses.
{-# Language BlockArguments #-}
myhtml :: Html
myhtml =
html_ "My title" do
append_
do h1_ "Heading"
do append_
do p_ "Paragraph #1"
do p_ "Paragraph #2"
or using the associativity of append_ = (<>)
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"
]
All examples of 'concat . map' can be replaced with.. concatMap :Ð
Also in the detour about kinds they are written as * while the ecosystem is moving towards a more uniform Type name.
{-# Language StandaloneKindSignatures #-}
import Data.Kind (Type)
type Tuple :: Type -> Type -> Type
data Tuple a b = Tuple a b
type Either :: Type -> Type -> Type
data Either a b = Left a | Right b
Thank you. I'm glad you're enjoying it. Sorry if I sounded a bit aggressive here.
I think one of the cool things about Haskell is that there's quite a high ceiling in terms of solutions you can reach for. On many occasions when one get annoyed by something and thinks "there must be a better way", there is one.
You show how one with more knowledge and command of the language can make it do a lot of things for free, and that is very cool! But I can also see how these solutions can look a bit intimidating for people with less experience, and it's important to take this into account as well.
This is kind of a double edged sword. Gotta find the right balance.
I didn't take it as aggressive. I hope people who are curious get something out of my comment but without intimidating others, perhaps I write it as a bonus that people can ignore if it doesn't help but you are right that some people could be put off by it.
I'm using this for my 10th? shot at diving into Haskell. I'd certainly appreciate bonus material on emerging best standards that is just starred and put into an appendix.
In addition to the other good answers you've gotten, I would like to point out that Haskell has QuickCheck (https://hackage.haskell.org/package/QuickCheck) which, if I'm not mistaken, more or less pioneered property testing. Property testing libraries are available in many languages now but they never seem to be as capture the magic of QuickCheck. (There's also https://hackage.haskell.org/package/hedgehog which is sort of a "modern alternative" to QuickCheck but I still prefer the OG).
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.
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 (https://github.com/LaurentRDC/pandoc-plot), which was ultimately useful to create my PhD dissertation.
There's only so much you can learn about Haskell by working through toy examples.