Live data from Hacker News

Basics of Haskell – Code and exercises

github.com

1–10 of 47 posts

Re: Basics of Haskell – Code and exercises

#4
Writing interpreters in Haskell (which is what some of the lessons seem to be about) is a great way to learn the language. It naturally motivates recursion, algebraic data types, strong types, higher-order functions and later, when effects such as state and errors are needed, monads arise naturally.

The best part? It takes a ridiculously small amount of code to do all that, maybe around a hundred or less. Languages without ADTs and higher-order functions bend over backwards to recover them[0] via design patterns.

[0] http://www.cs.ox.ac.uk/jeremy.gibbons/publications/hodgp.pdf

Re: Basics of Haskell – Code and exercises

#5

Bartosz is always doing great stuff. Check out is Category Theory lectures for people who know Haskell: https://www.youtube.com/user/DrBartosz

Also I personally recommend to take a look to this series before diving into his great introductory book about category theory [1]. Seeing the application of the theoretical concepts and deriving the code yourself makes it more approachable for completly begginers from my experience.

1. https://github.com/hmemcpy/milewski-ctfp-pdf

Re: Basics of Haskell – Code and exercises

#7
post #3

My university teaches the intro CS course in Racket (lisp), and I know another that teaches in Haskell. If decades of priority exposure to young programmers is not enough to spur widespread adoption, then I'm not hopeful.

I don't think that's the point of having the intro CS course in a functional language. The concepts that you get taught there can also be applied outside of pure functional languages and they teach you a different way to think about programming.

Re: Basics of Haskell – Code and exercises

#9
post #5

Bartosz is always doing great stuff. Check out is Category Theory lectures for people who know Haskell: https://www.youtube.com/user/DrBartosz

Also I personally recommend to take a look to this series before diving into his great introductory book about category theory [1]. Seeing the application of the theoretical concepts and deriving the code yourself makes it more approachable for completly begginers from my experience. 1. https://github.com/hmemcpy/milewski-ctfp-pdf

I liked his introduction to Category Theory enough to buy the extremely well-done hardcover edition:

https://www.blurb.com/b/9621951-category-theory-for-programm...

The only introductory treatment of Category Theory for non-specialists that I’ve encountered that even competes with it is Spivak’s “Category Theory for the Sciences.” For the curious, Eugenia Cheng’s books for lay audiences are excellent for getting a feel of the power and value of the Category Theoretical approach.

Category Theory is somewhat unique in being a recently developed area of advanced maths that is nevertheless approachable with only modest formal training. Because it maps so well to much of the theory and practice of functional programming, most programmers with even a little interest and familiarity with that will be able to engage with the fundamentals, and Milewski does a masterful job of introducing it to that audience.

Re: Basics of Haskell – Code and exercises

#10
post #4

Writing interpreters in Haskell (which is what some of the lessons seem to be about) is a great way to learn the language. It naturally motivates recursion, algebraic data types, strong types, higher-order functions and later, when effects such as state and errors are needed, monads arise naturally. The best part? It takes a ridiculously small amount of code to do all that, maybe around a hundred or less. Languages w…

It also introduces you to the expression problem pretty quickly and organically :)

I agree with the comment though. I learned Haskell and how to write an interpreter at the same time by working through the book Crafting Interpreters. It was a great match.

Post reply on HN