
How Do I Learn Some Functional Programming? - mr_mig
http://www.fse.guru/how-do-i-learn-some-fp
======
ekr
I can't recommend CIS 194
([http://www.seas.upenn.edu/~cis194/](http://www.seas.upenn.edu/~cis194/))
enough. After a first weak attempt at learning haskell, following this course
did it for me, and I've managed to write some significant haskell programs.

It covers all the fundamental abstractions found in functional programming,
and the homework has some close-to-real-life examples that students must do.

5 stars.

------
StreamBright
I am not sure if this article was a joke or somebody seriously think that
functional programming should be learnt by Ruby, JS and Scala. I have learnt
much more by using Erlang, Clojure and some parts of OCaml. Learning for just
learning programming in general and getting into the most popular languages is
a different subject though. If I was to learn FP I would start with Elixir and
probably with Racket just to learn a LISP dialect. It is much fun.

~~~
runT1ME
The book _Functional Programming in Scala_ is widely regarded as one of the
best books on functional programming in any language. It has very little to do
with the Scala language and everything to do with how you would write purely
functional programs for the real world (file systems, concurrency, etc).

~~~
StreamBright
Sadly you did not reflect to anything I wrote. I bet the Scala book is pretty
good, however I would still learn programming from SICP if I just wanted to
learn how to write purely functional programs. This is just a matter of taste.

------
hiram112
Learning through reading is one thing, but I've found that I never truly
understand the concepts until I begin to write some code in a functional way.

We have some Scala in my work environment. I had taken the course, read the
book, and spent a little time writing some code, though as deadlines got
tight, I would revert back to Java.

It wasn't until I forced myself to write everything in Scala that some of the
idiomatic patterns started to make sense. For example, an export job was
timing out due to numerous synchronous calls to external services. I rewrote
it using async Futures with flatmap and collect, and it was much faster.

Even though I had read about Futures and their functional use a dozen
different times, I realized I truly didn't understand them 'till I could apply
them to a concrete problem I had. Also, Twitter puts out a lot of really good
Scala stuff: Twitter school, Effective Scala, Finagle and Finatra, etc.

TLDR; read the books while writing some code.

------
waterlink
I can recommend reading Practical Object-Oriented Design in Ruby by Sandi Metz
to every programmer out there. This is so much important to understand basics
of Code Design. Even if you think you will not be doing any functional or
object-oriented programming, still, go ahead and read it.

------
SwellJoe
The book that helped me the most in terms of pragmatic use of functional
concepts in real world applications was _Higher Order Perl_. The examples have
been translated into several other languages, if Perl gives you hives (I quite
like Perl, but I know it is scary for some folks). It really does a great job
of demonstrating from the lowest levels of a functional system (closures,
recursion, first class functions, etc.) on up to actually doing things with
those basic building blocks.

It is certainly not "pure", but if you're coming from a procedural/OO world
mindset, it's a fantastic bridge. That said, it doesn't cover some of the
newer features of some modern FP languages, and won't necessarily directly
apply to writing in Haskell or ML.

------
xiaoma
Realm of Racket is a fun and engaging book. It will guide you through making
successively more complex and interesting games using a Racket, which is
modern and fairly widely used type of Scheme.

------
acemarke
The React and Redux community is heavily influenced by Functional Programming.
Because of that, I've collected a number of friendlier / easier-to-read
articles on understanding FP as part of my React/Redux links list:
[https://github.com/markerikson/react-redux-
links/blob/master...](https://github.com/markerikson/react-redux-
links/blob/master/functional-programming.md) . Some pretty good articles in
there.

------
tim333
Depends a bit on how deep you want to learn but I found using underscore in
javascript helpfull [https://smthngsmwhr.wordpress.com/2014/02/02/eloquent-
javasc...](https://smthngsmwhr.wordpress.com/2014/02/02/eloquent-javascript-
with-underscore-js/)

The problem I had with full on functional stuff was seeing what the point is -
ok you could replace your for loop with some weird recursive stuff which the
compiler will turn back to imperative behind the scenes so it will run quick
but I had a trouble seeing why. However replacing some javascript loops with
underscore stuff I was able to see how it was more compact and less bug prone.
Also it doesn't take long to get.

------
hcrisp
There is this free ebook on functional programming in Python by O'Reilly:
[http://www.oreilly.com/programming/free/functional-
programmi...](http://www.oreilly.com/programming/free/functional-programming-
python.csp)

~~~
agumonkey
Apparently it's been 'open sourced'

[https://archive.org/details/functional-programming-
python](https://archive.org/details/functional-programming-python)

ps: once upon a time I stumbled upon a FP article in python dealing with
designing (not applying known patterns) function call protocols to solve
aritmethic problems. Asked on HN already but nobody could help. So just in
case it rings someone else's bell .. feel free to reply.

