Live data from Hacker News

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

news.ycombinator.com

31–40 of 67 posts

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

#31
Haskell Programming from First Principles is probably the best and most exhaustive resource on learning Haskell.

I now refer people to “Effective Haskell” by Rebecca Skinner[0]. It’s well written, modern (published in 2023) and goes into everything you need to know to use haskell in common, real world tasks.

[0] https://pragprog.com/titles/rshaskell/effective-haskell/

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

#32
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…

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

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

#34
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.

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

#37
I think Learn you a Haskell is a good introduction, but you will learn more by doing.

I don't know what state of the art is nowadays for learning Haskell, I started my journey more than 10 years ago, but for help I recommend https://discourse.haskell.org/ whenever you feel stuck, have questions; instead of SO/subreddit.

edit: while Copilot, or equivalent, will hallucinate APIs that don't exist, I recommend having such a thing enabled as it will help you with syntax / standard library functions early on.

Also take a good look at the base, containers, directory, filepath, etc packages documentation. These come as part of the standard installation (with something like ghcup), and represent the "standard library" you have access to (on paper that would be only limited to base). For a full list of installed packages you can always run `ghc-pkg list` and start browsing the generated documentation on hackage.haskell.org

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

#38
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…

...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

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

#39
post #24

What is the appeal of haskell? Genuinely curious

Before Haskell I felt like I was cargo-culting advice - "use private fields with getters & setters", "everything should have an interface", "avoid static methods", "avoid 'new' and use factories instead". I figured eventually one of these days these things would click.

With Haskell came new principles which had immediately obvious value - "is your function well-defined over all possible inputs?" and "does it always produce the same output given the same input?".

I later 'got' that first set of principles, but I mostly disagree with them.

My day job has always involved looking at exceptions and logs, figuring out "how something went wrong", and then trying to fix it. Guess which set of principles helps me make software that typically "just works".

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

#40
post #19

Haven’t touched Haskell in years, but I found the best guide was Brent Yorgey’s old UPenn CIS194 online class. It contains easy to digest text lectures with follow up classwork. I successfully taught dozens of people who had no former functional background. Just did a weekly meeting covering the lecture and prior week’s homework. https://www.cis.upenn.edu/~cis1940/spring13/lectures.html

It's also my favorite beginners resource. And free.

Straightforward and short. Takes you to the interesting bits very quickly.

Post reply on HN