Live data from Hacker News

Ask HN: What resources do you recommend for learning Haskell?

news.ycombinator.com

41–50 of 67 posts

Re: Ask HN: What resources do you recommend for learning Haskell?

#41
https://www.manning.com/books/get-programming-with-haskell

Get Programming With Haskell by Will Kurt. Made up of small lessons that all build on top of each other and will really help you understand what's going on.

I wanted to like Effective Haskell but honestly didn't. YMMV.

Re: Ask HN: What resources do you recommend for learning Haskell?

#42
Learning haskell is like learning to program from scratch. Do you remember the your journey learning to code for the first time? If you're anything like me, that was a lot of banging your head against the wall, trying all sorts of different resources, giving up only to try again a little while later, and then one day everything starts to click. It's all part of the journey.

Haskell is so different from all the languages people tend to learn so it feels much like learning to code all over again. That being said, it's totally worth it! I'm a much better developer (in any language) thanks to all the wonderful things haskell has taught me. I'm much better at designing clean abstractions, I have more tools for solving problems, I have more fun coding, and new challenges don't scare me so much because I know I just need to go through the process and I'll come out the other side even better.

To answer your question, there was no one resource that worked for me. It was just a matter of time and effort going through lots of resources until one day my brain had established new neural connections and things clicked. I read several books and watched lots of people writing haskell and explaining the new (to me) concepts on twitch and youtube.

Re: Ask HN: What resources do you recommend for learning Haskell?

#44
Real World Haskell was pretty good last time I read it. It has lots of concrete code examples that you can use in real world applications. It won't bore you to death with abstract theory and instead it will blend it with real world problems and make learning both fun and useful at the same time.

Re: Ask HN: What resources do you recommend for learning Haskell?

#46
post #24

What is the appeal of haskell? Genuinely curious

It takes an idea[0] and runs with it as far as it goes. The best part is that when they got to obstacles like handling of IO, they didn't take the easy route and compromise the vision in favor of a pragmatic solution. Instead they went into unexplored territory and came back with monads, which proved an extremely fertile ground for more than IO.

Obviously, Haskell being an academic language helps here, since novel ideas lead to papers and boring old ideas don't.

[0]: That is statically typed lazy functional programming.

Re: Ask HN: What resources do you recommend for learning Haskell?

#47
I can only speak about my personal experience.

When I was in college I read through Haskell Programming From First Principles. My prior programming experience (of probably ~10ish years, as a hobbyist) was mostly C++, Java and PHP.

I found it grueling. I really was just not used to reading definitions like

  newtype State s a = State { runState :: s -> (a, s) }
  instance Monad (State s) where
      return x = State $ \s -> (x,s)
      (State h) >>= f = State $ \s -> let (a, newState) = h s
                                          (State g) = f a
                                      in  g newState
Nowadays, such a definition (and its practical applications) seems very trivial, but at the time I remember it felt like learning a new type of math, or a new language. Most of my time reading that book was spent struggling to figure out how the types fit together and why they were useful and/or necessary to be structured the way they were.

This wasn't the book's fault - I actually think the book does go to great lengths to try to guide the reader gradually toward understanding. My brain just wasn't ready for it. It took a long time of playing around with Haskell, as well as playing around with other languages (and seeing things like async-await and thinking to myself "hey! that's a monad!") before these things became second nature. I think it just goes to the concept of "osmosis" in psychology - sometimes you subconsciously absorb information over time before it starts to make sense.

Dunno if this comment constitutes "advice" per se, lol. Just offering you something to relate to, I guess.

Re: Ask HN: What resources do you recommend for learning Haskell?

#48
post #21

Perhaps contrary to most people in this thread, I think you should avoid learning lenses or category theory too early. These are great tools, but they take months or even years to master and are not required to write useful code in the language. I find Haskell very useful for my projects, but to achieve this I restrict myself to the basic subset of the language (Haskell 2010, no fancy extensions such as type families…

I like this advice, but I would suggest adopting a prelude that has better defaults than what the language ships with.

Is there one you'd recommend?

Re: Ask HN: What resources do you recommend for learning Haskell?

#49
I'd recommend Well-Typed's YouTube channel: https://www.youtube.com/@well-typed

Andres Loeh has recently released a pretty comprehensive introductory series there and in addition they have a fortnightly stream "The Haskell Unfolder" where they go over some more advanced subjects with examples.

Re: Ask HN: What resources do you recommend for learning Haskell?

#50

Earlier quoted context omitted.

...what are lenses? Never heard of those.

As with anything Haskell, one could simply reply with "here's the formal definition." But in easily digestible terms, it's a way to narrow your view over a collection to a subset that satisfies some property, and perhaps perform some operations on that subset. This video presentation (with a very humorous audience dynamic, might I add) serves as a great introduction by example: https://youtube.com/watch?v=QZy4Yml3LTY

I'm going to watch the video, but I'm having trouble understanding how lenses are different from filter, and perhaps map. Is it just a combination of filter and map?
Post reply on HN