Ask HN: Learning Functional Programming in 2022?

16 points by low_tech_punk ↗ HN
My gateway drug was Grokking Simplicity by Eric Normand. I'd love to know where to go next. A little bit about myself:

- 5 years of OOP in TypeScript

- Enjoyed React's shift towards functional paradigm

- Enjoyed RxJS

- Looked into Haskell and lisp, but can't find good places to use them: I tried Xmonad, and Emacs, but sorry, I didn't have a use case for neither of them.

- Had shallow experience in C/C#/Java/Python

- Enjoy programming as a creative activity; willing to spent lots of time honing my skills.

9 comments

[ 3.1 ms ] story [ 36.7 ms ] thread
Sounds like you are mostly frontend. I can highly recommend ReScript https://rescript-lang.org/

I learned a lot about functional programming from it.

It is a more frontend focussed https://reasonml.github.io/ which is all based on OCaml. It has the same awesome type system and all the FP goodies while providing easy TS/JS interop and convenient escape hatches.

It compiles (very fast) to highly efficient readable JS that you can use wherever.

Thanks! I saw ReScript's compiler is written in OCaml, so there is definitely a lineage. Will check it out!
F#, Elixir, Erlang, Clojure, and Racket is where I would concentrate. Pick one and go for it. Find books that work through a domain in a project-like style and port the code to your language of choice.

Check out the course Programming Languages by Dan Grossman on Coursera.

Some background: I'm an experienced Scala dev who started out with Haskell.

Consider Elm since you're familiar with building web UIs. You can try re-implementing a project. And it's Haskell-inspired.

Otherwise, I'd say learning FP is about first learning how to use algebraic data types (ATDs) and the typeclass pattern. Once these two things become clear, some of the common typeclasses like Functor and Monad will become easy to grok. And both of those concept can be explored in Elm.