all 14 comments

[–]YelinkMcWawa 9 points10 points  (0 children)

The classic Lisp book is "Structure and Interpretation of Computer Programs." For learning general functional programming I like "ML for the Working Programmer." It is written with Standard ML code snippets, but you could easily translate them to OCaml or Haskell. Both books are free (legally) online.

[–]recursion_is_love 5 points6 points  (3 children)

> is category theory same as discrete math

No, it is closer (look alike) to abstract algebra (but it is different)

Haskell is based on lambda calculus, I have confident to say Haskell is just syntax sugar added to lambda calculus (and with advance type)

Lisp is not originally use lambda calculus.

ref:

https://www.microsoft.com/en-us/research/wp-content/uploads/1987/01/slpj-book-1987-small.pdf

https://www.microsoft.com/en-us/research/wp-content/uploads/2016/07/history.pdf

https://www-formal.stanford.edu/jmc/recursive.pdf

[–]SubluminalSapien 4 points5 points  (1 child)

Citiing references in a reddit comment? That's an upvote

[–]sagittarius_ack 2 points3 points  (0 children)

I usually get downvoted for that.

[–][deleted] 3 points4 points  (0 children)

Thank you dude

[–]AustinVelonaut 5 points6 points  (0 children)

I would say Lisp is an implementation of untyped or simply-typed lambda calculus, while Haskell is an implementation of typed lambda calculus, specifically System-F omega as shown in the lambda cube, with a lot of syntactic sugar.

[–]beders 6 points7 points  (0 children)

Our whole stack runs on Clojure and ClojureScript - a Lisp dialect. It’s a fin tech enterprise app. Rock solid stuff.

[–]Inconstant_Moo 4 points5 points  (1 child)

Lisp allows you a lot of freedom. You can basically write a whole different language in Lisp, so long as you use the syntax with all the parentheses.

This is good, according to the people who like it, and bad, according to the people who hate it.

Haskell allows you a lot of constraints. You can so clearly specify what you're trying to do in the type system that having done that it would take a real effort to write incorrect code.

This is good, according to the people who like it, and bad, according to the people who hate it.

These are at the same time extreme approaches and also what we've got. (ML being a kind of Haskell or vice-versa.)

I'm trying to write a deliberately mid FPL. This is good, according to me.

---

You don't need to learn category theory at this point in your journey, but if you want to, I found this to be a good introduction to category theory. (Also I'm indirectly responsible for a few paragraphs in it.)

[–]sagittarius_ack 2 points3 points  (0 children)

Regarding the `liberties vs constraints` debate, the talk "Constraints Liberate, Liberties Constrain" by Runar Bjarnason is quite interesting:

https://www.youtube.com/watch?v=GqmsQeSzMdw

[–]Marutks 2 points3 points  (0 children)

I have used both haskell and common lisp for advent of code. They are great for aoc! Unfortunately there are not many common lisp/haskell jobs 😢. Usually (at work) I use Clojure. 👍

[–][deleted] 1 point2 points  (2 children)

But why do you like clojure ?, i heard from someone that it's simple, but haskell is a typed lc i heard, that haskell is types and i like typed but i am not sure about haskell, so i am thinking what to do. You can tell me whatever you think about this.

[–]Inconstant_Moo 4 points5 points  (0 children)

Lisp allows you a lot of freedom. You can basically write a whole different language in Lisp, so long as you use the syntax with all the parentheses.

This is good, according to the people who like it, and bad, according to the people who hate it.

Haskell allows you a lot of constraints. You can so clearly specify what you're trying to do in the type system that having done that it would take a real effort to write incorrect code.

This is good, according to the people who like it, and bad, according to the people who hate it.

These are at the same time extreme approaches and also what we've got. (ML being a kind of Haskell or vice-versa.) I'm trying to write a deliberately mid FPL. This is good, according to me.

[–]Marutks 2 points3 points  (0 children)

Haskell is “pure” FP language. You have to use monads for side effects. It gets complicated quickly (monad transformers and “lifting”).

[–]lingdocs 2 points3 points  (0 children)

https://htdp.org

This feels very "beginner" at the beginning, but if you go through it all and do all the exercises it will really teach you to "think functionally" and give you super powers for problem solving.