Does anyone have any recommendations for starting in functional programming?

I am looking for some e-books to help me learn functional programming. I have not decided yet which language I will go, but I noticed quite a bit of prejudice towards LISP, Haskell and F # among the community in StackOverflow. So far I'm not sure which direction I will take, but can anyone recommend any e-books on this subject? Also, if anyone could provide a convincing argument for which a functional language would be the most interesting for me, I would be very interested to hear your opinion.

I am particularly interested in e-books because I managed to get myself a Sony e-reader application for Christmas, and I am looking to download it with useful material for my endless quest to become a better programmer.

+45
functional-programming lisp haskell f #
Jan 11 '09 at 3:22
source share
19 answers

I recommend Haskell . Please check out this other question: Getting started with Haskell .

Reasons in favor of Haskell:

  • From a personal point of view, first of all: I spent a significant amount of my early years of programming, thinking about developing my own programming language. (For example, I highly recommend the textbook Pragmatics of Programming Language .) When I first came across Haskell, I realized that he included many of the ideas that I had, plus many more, and all this was much better than I could do myself.
  • This is a very clean implementation of functional ideals: lazy (non-strict) and (polymorphic) statically typed. No side effects!
  • A system of its type can change your perception of the types of systems. (The Hindley-Milner type inference is amazing.)
  • His alternative view of object-oriented programming and polymorphism is great.

Lisp is also a good choice. Reasons for Lisp:

  • Historically, the first functional programming language (or the first huge).
  • The worldview "everything is a list" is very minimalistic, simple and beautiful.

If you choose the Lisp option, I recommend Scheme .

I did not use OCaml or Ruby, but some of my friends swear by them, although it can be argued how functional they are. On the other hand, their "multi-paradigm" character makes them very convenient in practice.

In conclusion, I suggest you choose the language that follows Alan Perlis’s advice: "A language that does not affect how you think about programming is not worth knowing." Lisp, and Haskell changed my world. I hope that no matter what language you choose, it will change your world.

+49
Jan 11 '09 at 3:31
source share

I just started to give video lectures on the Structure and interpretation of computer programs , and I think they are wonderful. They accept Schema, which is a variant of LISP, as a programming language. But this is not the point of the course: we are talking about the whole concept of "computing" and its consequences.

+27
Jan 11 '09 at 3:28
source share

One of the best functional programming tutorials (my friend gave me) Teach you at Haskell for Great Good! . This tutorial is about Haskell, but the basics are very well presented in the correct order. It was very clear to me.

+15
Mar 18 '09 at 13:18
source share

Obviously, it depends.

Are you familiar with the C # and .Net framework? If so, then you will start using F #. If you have Visual Studio, you can play with F # too, so that the other learning curve is smoothed out.

It also depends on whether you just want to "functionally program" to expand horizons or use them for a while. If you just understand, then start anywhere, but if you intend to use it, choose what is compatible with your current structure.

My 2 cents / pence

+8
Jan 12 '09 at 9:39
source share

I'm in the middle of reading Another Haskell tutorial and this is a very useful and well written Haskell book.

+7
Jan 11 '09 at 3:35
source share

Practical, General Lisp is a fantastic book if you are interested in diving in Lisp. This is not at all like many languages, but I felt like pushing myself to find out that this was one of the most useful events in my programming career. The limited syntax makes for a very flexible language that is relatively easy to learn, but conceptually it will take some time to wrap itself around.

+7
Jan 11 '09 at 3:54
source share

Perhaps one option is to pull out the entire online version of Real World Haskell ?

This is a good book to learn about Haskell, but perhaps it should be combined with a more general book on functional programming.

+7
Jan 17 '09 at 9:52
source share

I would recommend any of the ML (standard ML or OCaml - good) dialects for the language.

They have had a huge impact on Haskell and represent a slightly softer introduction to FP than Haskell.

+4
Jan 11 '09 at 5:09
source share

I would start with Lisp (in particular Scheme) because it is simple; it has a very simple syntax and a static type system to worry about.

The structure and interpretation of computer programs will not only introduce you to the Scheme, but also teach you all the basic programming paradigms. Full text is licensed under Creative Commons.

After that, it will be easier for you to learn additional Haskell functions, i.e. more complex syntax, lazy evaluation and a powerful type system.

+4
Jan 11 '09 at 9:27
source share

"How to create programs": http://www.htdp.org/

By the way, what are your goals?

+3
Jan 11 '09 at 6:38
source share

I hope you have chosen Erlang or Lisp. (Forth) There you have the smartest languages ​​that I know.

Where should I go after Erlang, Lisp and Forth, please leave a comment.

+3
Jan 11 '09 at 8:40
source share

I would go with "Joy Clojure".

I assume you already know Java. Clojure runs on the JVM, is purely functional (with some exceptions that may facilitate concurrent programming), and is lisp. It has all the benefits of the lisp mentioned above (tail opera optimization), with some huge benefits such as Java compatibility, advanced robust data structures and a large and vibrant community. If you want to know something that one day you have a chance to work professionally, go with Clojure (or F # if you can flinch .net).

http://www.manning.com/fogus/

+3
May 23 '11 at 21:24
source share

I could take this place, but I say, go get Ruby. This is a very beautiful and modern hybrid functional language OO, and it will gently introduce you to the world of functional programming. Or any other language with closure and high-order functions (it must be either dynamically typed or with an output type, otherwise it is really difficult to write functional code).

As soon as you feel comfortable working with Ruby FP, or if you do not want to listen to my best advice, try something like Scheme. It is an elegant and gentle language.

If you start with Common Lisp or Ocaml or Erlang or especially Haskell, you are likely to get scared and you will feel lost for various reasons. If you like the circuit, you can try them, but I would suggest starting with them. Few go so far.

+2
Jan 11 '09 at 3:34
source share

I am by no means an expert on this, but personally, I think that starting with a diagram might be a good idea. From what I know, the schema is a simplified version of LISP, think of it as LISP, but only with the main aspects. I think that the syntax of the scheme is extremely clean, you need to go through parentheses, but it really helped me to get into the “feeling” of functional programming, without learning the language features.

+2
Jan 11 '09 at 9:26 a.m.
source share

Two great books:

"The structure and interpretation of computer programs" (Abelson and Sussman) and "Concepts, methods and models of computer programming" (Peter Van Roy and Safe Haridi).

Both cover much more than functional programming.

+1
Jan 12 '09 at 16:49
source share

I will force Real Haskell and add: " Haskell: Craft functional programming .

+1
Jan 20 '09 at 20:54
source share

I really found meaning in Taste of Haskell . This is a conversation by Simon Peyton Jones. This is a really good overview and a first look at a language targeted at non-FP programmers.

Part 2 of the conversation and PDF slides . The camera never shows slides, so PDF really helps.

+1
Feb 13 '09 at 10:47
source share

Lisps are the only ones with regular core syntax and well-defined standards (in the case of CL and Scheme). They make up for an enlightened ride.

I recommend Common Lisp.

It has good and free books for beginners, see Lamkins' Successful Lisp and Practical General Lisp:

0
Feb 14 '09 at 8:58
source share

To move from imperative programming, I would suggest Chris Smith programming F # . A. Rex's second comment above on Haskell resources and other contributors about SICP .

0
Apr 09 '11 at 19:15
source share



All Articles