4 ms·
This is fantastic. I have played around with Clojure and Haskell a bit, but really want to get into functional programming more. Not to hijack the thread, but I
by altotrees 9y ago
This is fantastic. I have played around with Clojure and Haskell a bit, but really want to get into functional programming more. Not to hijack the thread, but I guess I am having trouble getting started. Any good resources for novices out there?
Edit: for the record I have Googled the topic and am overwhelmed by how much is out there. Looking for personal recommendations.
- yen223 9y agoI highly recommend https://fsharpforfunandprofit.com/ https://fsharpforfunandprofit.com/. F# is spiritually similar to OCaml, so there's a lot of crossover there. This is geared towards "enterprise" developers, and so tends to be more pragmatic than most other resources. For what it's worth, I got a surprising amount of mileage from learning Idris[0], of all things. Even if you ignore the dependent type system, it is still essentially Haskell but with a lot of the warts removed, making it much simpler to grok. Beyond that, the usual recommendations apply: Learn You a Haskell[1], and Real World OCaml[2] were what got me started. [0] http://docs.idris-lang.org/en/latest/ http://docs.idris-lang.org/en/latest/ [1] http://learnyouahaskell.com/chapters http://learnyouahaskell.com/chapters [2] http://dev.realworldocaml.org/ http://dev.realworldocaml.org/
- gilmi 9y agoIf you want to learn Haskell the most recommended book nowdays is Haskell Programming From First Principles[0]. [0]: http://haskellbook.com http://haskellbook.com
- nuclx 9y agoReal World Haskell[0] is the best freely available resource imho. If some concepts remain unclear, Learn You a Haskell[1] is a good complement, though it doesn't go as deep as Real World Haskell. For example there is no coverage of monad transformers, which is a pity. Typeclassopedia[2] is a great overview of common category-theoretic abstractions used in Haskell programs. [0] http://book.realworldhaskell.org/read/ http://book.realworldhaskell.org/read/ [1] http://learnyouahaskell.com/chapters http://learnyouahaskell.com/chapters [2] https://wiki.haskell.org/Typeclassopedia https://wiki.haskell.org/Typeclassopedia
- gaius 9y agoRWH chapters 1-3 are great. It goes a bit weird from chapter 4. LYAH is better IMHO.
- eru 9y agoThe consensus on the Haskell subreddit was that the Haskell Wikibook (https://en.wikibooks.org/wiki/Haskell https://en.wikibooks.org/wiki/Haskell) has gotten even better than "Haskell Programming From First Principles". In any case, that book ain't bad either. It's better than Learn You A Haskell. I also like "Discrete Mathematics Using a Computer" (https://github.com/ryukinix/discrete-mathematics/blob/master/ebooks/discrete-mathematics-using-computer.pdf https://github.com/ryukinix/discrete-mathematics/blob/master...). It focuses on teaching discrete mathematics and introduces some Haskell as executable mathematical notation on the side.
- djur 9y agoThe wikibook has gotten really good, and it's the reference I've started going to when I need a refresher on a concept, but HPfFP was the book that helped me actually "get" Haskell -- and I'd read pretty much every other beginner-to-intermediate resource by that point. My experience has been that, generally speaking, programmers of language [X] don't have a particularly good grasp of what makes a good introduction to language [X], and I think that effect is even stronger with a difficult language like Haskell. That said, I was about to read some of the new material in HPfFP, and I should also read the analogous wikibook content as an experiment. Thanks for linking it.
- eru 9y agoI do agree with your observation: I remember a particularly vivid example of some of my coworkers at Google suggesting the Go tutorial, starting at https://tour.golang.org/welcome/1 https://tour.golang.org/welcome/1, to someone completely new to programming. They couldn't even understand how it's not perfectly clear and simple. That being said the book that I've seen most success with getting someone from absolutely zero to "can start making progress on their own" is "How to Design Programs" (http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html http://www.ccs.neu.edu/home/matthias/HtDP2e/index.html). It helps that the authors regularly teach absolute beginners.
- arunc 9y agoFunctional programming in D could be a good start for you http://beza1e1.tuxen.de/articles/functional_D.html http://beza1e1.tuxen.de/articles/functional_D.html https://tour.dlang.org/tour/en/gems/functional-programming https://tour.dlang.org/tour/en/gems/functional-programming
- a0 9y agoThere’s a beginner’s guide to OCaml’s beginner’s guides: http://blog.nullspace.io/beginners-guide-to-ocaml-beginners-guides.html http://blog.nullspace.io/beginners-guide-to-ocaml-beginners-...
- joshmarlow 9y agoThe way I first learned to think functionally was reading and working through http://realmofracket.com/ http://realmofracket.com/ It intros you to Racket, which is sort of a Scheme dialect (which is a Lisp dialect) and teaches functional programming. Haskell, OCaml, etc take those functional idioms and apply strong typing, algebraic data types, pattern matching and something like the Option/Maybe type - but they build on the same functional concepts in Realm of Racket. Caveats to the above: 1) Racket has an optional 'typed' variant which gives you type checking. 2) Rust is (IMHO) a little weaker with regards to pure functional programming than OCaml, but very nicely integrates pattern matching, type checking and algebraic data types in.
- sbov 9y agoAs an FP newbie, for Clojure, I used https://www.braveclojure.com/ https://www.braveclojure.com/ to start with. When I wanted to build something beyond a toy program, https://pragprog.com/book/vmclojeco/clojure-applied https://pragprog.com/book/vmclojeco/clojure-applied helped me immensely. It goes beyond "what you can do" and delves into "when you should do it". IMHO every language should have a book like this.
- yawaramin 9y agoIMO, the best functional programming resource out there is this free online course by Prof. Dan Grossman at UW: https://www.coursera.org/learn/programming-languages https://www.coursera.org/learn/programming-languages He focuses on teaching the syntax, semantics, and idiom of Standard ML, a classic functional programming language that's closely related to OCaml, Haskell, and others. He has a gift for explaining simply and clearly and keeps his lecture videos short (~10min) which helps to absorb their info. Check it out: https://www.coursera.org/learn/programming-languages https://www.coursera.org/learn/programming-languages