Live data from Hacker News

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

news.ycombinator.com

21–30 of 67 posts

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

#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 or GADTs) and use few libraries aside from the core libraries. New features and libraries always carry a high learning curve in Haskell and less popular libraries can be buggy. Instead, you will often be more productive just writing the required functionality from scratch (and it will teach you more too!).

At Jane Street, I saw my coworkers learn functional programming in just one week. (some still struggled with monads in the second week -- if that is you, I can recommend Phil's paper: https://homepages.inf.ed.ac.uk/wadler/papers/marktoberdorf/b...). If you are learning Haskell in your free time and with no one experienced to help, it will obviously take you longer. If you have questions, feel free to post on the Haskell IRC or Reddit. Just don't worry that you need to read another tutorial before getting started :)

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

#22

I recently started reading Bartosz Milewski's Category Theory for Programmers [0] and while it's less about Haskell per se and more about the ideas behind it, I found it did a much better job at explaining Haskell to me than any other introduction I read before. At least I'm able to appreciate Typing the Technical Interview [1] now. :-) [0]: https://github.com/hmemcpy/milewski-ctfp-pdf [1]: https://aphyr.com/posts/34…

This is a good source if you feel like waiting until chapter 14 for "so, anyways, that's how addition works." I know Haskell pretty well and I've bounced off Milewski's stuff multiple times.

Haskell != Category Theory. You don't have to know what an Endofunctor is in order to write useful programs. Haskell is just another programming language. It's totally possible to do cool stuff in it without knowing any of the theories that back a lot of the "why" behind its common abstractions.

Pick up any book and just start building toy programs! Don't over think it. Start very small. Make a CLI tool. Scrape some data off the internet. Even simple haskell programs will cause you to bump into all kinds of concepts at the time you need to learn them.

Just working through a book can make Haskell seem painfully esoteric. Monad transformers broke my brain when I tried to learn them simply because I reached the monad transformer chapter. However, I finally "got" them once I was actually building something, because their existence is something you naturally start to bump into the more you program. There's a friction that comes from no having them, but noticing that "friction" and letting it guide you can only happen over time as you use the language.

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

#23

I really liked https://haskellbook.com/ . It’s long, but has exercises after each chapter which I found very helpful. The first chapter is about Lambda Calculus which is kind of a Haskell meme at this point, but learning it actually did help me a lot to grok how Haskell programs are meant to fit together. Other than that, just doing some basic side projects and leaning about how to use Cabal effectively should get yo…

I love Haskell Programming from First Principles. It has details for everything. It has plenty of exercises you help you make friends with all of the "esoterica". Once I worked with the rules (e.g. how to make an instance of Applicative), they were a lot more concrete for me.

In Haskell, when you don't understand some detail it really comes back to get you. I read LYaH and I felt like I understood the big picture, but I didn't understand that it was critical to understand the types of _everything_ in an expression that I wrote. (My own failing.)

In summary: I highly recommend. https://HaskellBook.com

My background when I read it: 10+ years programming, 5+ years functional programming, 2 attempts reading LYaH (1 successfully). I still loved it. It would have saved me a lot of grief to start with the HB instead of LYaH.

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

#26

"What I wish I knew when learning Haskell" by Stephen Diehl[0][1]. It has commentary on a great deal of topics in Haskell and is very approachable. Also, learning to use Hoogle[2] will serve you well. [0] https://smunix.github.io/dev.stephendiehl.com/hask/index.htm... [1] https://github.com/sdiehl/wiwinwlh [2] https://hoogle.haskell.org/

This, and get comfortable letting the compiler (ghc) and the type system find errors for you. Change a piece of code and let the compiler tell you everywhere that is now broken. Fix it all. Continue coding.

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

#27
post #24

What is the appeal of haskell? Genuinely curious

pure functional. no mutations. (state and i/o handled with inscrutable magic).

basically every code base out there could use more functional effort - simple data structures and simple functions that operate on these to return a brand new structure.

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

#28
post #23

I really liked https://haskellbook.com/ . It’s long, but has exercises after each chapter which I found very helpful. The first chapter is about Lambda Calculus which is kind of a Haskell meme at this point, but learning it actually did help me a lot to grok how Haskell programs are meant to fit together. Other than that, just doing some basic side projects and leaning about how to use Cabal effectively should get yo…

I love Haskell Programming from First Principles. It has details for everything. It has plenty of exercises you help you make friends with all of the "esoterica". Once I worked with the rules (e.g. how to make an instance of Applicative), they were a lot more concrete for me. In Haskell, when you don't understand some detail it really comes back to get you. I read LYaH and I felt like I understood the big picture, bu…

+1 for HPFFP. The 1200 page behemoth that finally made everything, and I mean everything, click.

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

#29
Time. Learn a little Haskell this month. Learn a little Haskell in December. Some more over the next few years. In between you will be learning more about programming in general and many other things including how you learn.

There’s no midterm in eight weeks; no final grade after that, and nobody who matters cares how good or bad you are at Haskell. Like most things, it’s not worth having an opinion about.

Give yourself permission to write Haskell poorly because that makes it more likely you will write Haskell. Give yourself permission to not learn Haskell because maybe you like the idea of writing Haskell more than the work of learning Haskell…

…yep, time and permission are the best resources for learning Haskell (or anything else as an adult). It really doesn’t matter what book you pick. Either you enjoy committing or you don’t. Either the work feels satisfying while doing the work or doesn’t.

When the work is truly satisfying, it doesn’t need to be optimized against imagined external opinions. You just do it because it is what you do.

Or not. Good luck.

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

#30
I found these two videos on combinators and lambda calculus recently. They're only tangentially related to Haskell, but they are the most approachable videos on the topic I have ever seen.

https://www.youtube.com/watch?v=3VQ382QG-y4

https://www.youtube.com/watch?v=pAnLQ9jwN-E

Post reply on HN