News for hackers. Stuff that matters.

Ask HN: Learning Functional Programming in 2022?

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 | 16 points | on HN )
Re:Ask HN: Learning Functional Programming in 2022? by GiffertonThe3rd on Wednesday August 03, 2022 @02:49AM (#32328432)
Re:Ask HN: Learning Functional Programming in 2022? by mdcds on Wednesday August 03, 2022 @03:46PM (#32335970)
I don't use F#, but I've def enjoyed watching some of Scott Wlaschin's tech talks.

Like the FP patterns one. https://fsharpforfunandprofit.com/fppatterns/

Re:Ask HN: Learning Functional Programming in 2022? by low_tech_punk on Wednesday August 03, 2022 @04:00AM (#32328887)
Type safety purely from inference is so nice
Re:Ask HN: Learning Functional Programming in 2022? by mdcds on Wednesday August 03, 2022 @03:00PM (#32335526)
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.

Re:Ask HN: Learning Functional Programming in 2022? by r3a1d33p on Wednesday August 03, 2022 @01:45AM (#32328068)
I find this talk inspiring. Underscore.js got many things wrong for FP: https://www.youtube.com/watch?v=m3svKOdZijA.

I've read Grokking Simplicity too. It's very approachable book. Highly recommend it for JS/TS developers who want to learn FP!

Re:Ask HN: Learning Functional Programming in 2022? by treman on Wednesday August 03, 2022 @06:23AM (#32329817)
There’s a Corecursive episode [1] about Elm for front-end development that maybe could be helpful.

[1] https://corecursive.com/teaching-fp-with-richard-feldman/

Edit: spelling

Re:Ask HN: Learning Functional Programming in 2022? by bmitc on Wednesday August 03, 2022 @05:33AM (#32329517)
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.

Re:Ask HN: Learning Functional Programming in 2022? by codeptualize on Wednesday August 03, 2022 @03:01AM (#32328513)
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.

Re:Ask HN: Learning Functional Programming in 2022? by low_tech_punk on Wednesday August 03, 2022 @03:57AM (#32328870)
Thanks! I saw ReScript's compiler is written in OCaml, so there is definitely a lineage. Will check it out!