I've heard it's better to read the first edition of "Introduction to Functional Programming" by Bird & Wadler than the second edition. The first edition uses Miranda, and the second edition uses Haskell.
Is this a common recommendation? My goal is to get serious about functional programming. Thoroughly knowing the concepts of functional programming is more important to me than knowing a language's syntax, so I'm fine with learning Miranda if the first edition is somehow better.
I know F# and Scala.
The biggest plus of learning a functional language before learning an OOP lang is that your programming skills get developed first and then you can easily grasp the OOP concepts.
One of the elements which make people say that functional programming code is difficult to read is that it gives preference to a more compact syntax. Long answer: Functional programming itself cannot be readable or unreadable, since it's a paradigm, not a style of writing code.
The simplest way to get started is Dr Racket. Racket is a language of its own (another dialect of Lisp) but it supports the Scheme compiler as a subset and provides rich auto-formatting, static code analysis, and debugging features out-of-the-box.
I strongly recommend the second edition, which is an extensively revised, extended and mostly improved revision of the first edition. I have read both editions. The first edition has an example on solving the 8 queens problem with backtracking, unfortunately this example was dropped in the second edition. The second edition is my favourite book on Haskell.
The examples are from mathematics, including proof by induction. The material on deriving programs from their specifications by Bird in the second edition is awesome, I love this book. If you can handle examples from maths, this book is superb.
I think this book is also a great introductory text on Haskell, however I found that as soon as I tried writing Haskell programs that I often had to read material from other tutorials, and kept having to refer to Real World Haskell.
Another great text on mathematics and logic, with examples using Haskell that helps to understand the maths, is the Haskell Road to Logic, Maths and Programming. Bird's text goes much deeper on Haskell programming.
I haven't read Bird & Wadler, but Miranda and Haskell are similar--purely functional, nonstrict, statically typed, etc. If language is your only consideration when choosing the edition, I'd choose Haskell because it's more popular and free, and hence easier to get hands-on experience with.
I haven't used Miranda, but my understanding is that it's the primary predecessor to Haskell and that Haskell would not have existed unless its creator had closed the source and tried to make it a commercial product. It's still referred to as MirandaTM sometimes because of this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With