[Haskell-beginners] Functional programming principles at higher levels?

mike.w.meyer@gmail.com mwm at mired.org
Mon Sep 26 01:26:28 CEST 2011


Christopher Howard <christopher.howard at frigidcode.com> wrote:
>On 09/24/2011 09:12 PM, Mike Meyer wrote:
>> Actually, functional programming and the higher math are separate
>> things. Haskell (and I expect the similar languages) have a lot of
>> math in their documentation. But that's not true for other functional
>> languages, like Clojure or Scheme. With a background in those
>> languages, I didn't have much trouble with the functional nature of
>> haskell. But I'm still trying to recall the graduate math courses I
>> took long time ago in a state far, far different from today.
>Really? I'll confess I'm a bit surprised to hear that perspective. I 
>don't know anything about Clojure or Scheme.

In that case, you really don't have any reason for being surprised, do you? It may well be easier to start out with something like 'Structure and Interpretation of Computer Programs' (should be read by every programmer anyway) using Scheme than diving directly into a Haskell text with all the math. But I wouldn't give up on the Haskell texts just yet.

>But I found in trying to 
>understand Haskell that it really is all about higher math. Once I 
>finally gave up on "learnyouahaskell" and other ridiculous tutorials, I
>found the real functional programming textbooks, and discovered that it
>all starts with lambda calculus; all the explanations are given in set 
>theory notation, with occasionally comparisons to integral and 
>differential calculus for illustration, with very specific rules 
>regarding substitution and reduction and normal forms. 

Whereas your typical LISP tutorial will just touch on lambda calculus to explain some of the names being used (like "lambda" and "curry").

On the other hand, 'Real World Haskell' doesn't involve all that much math, either. Nor did what I got through of 'Write yourself a Scheme in 48 Hours' (I switched to RWH because you can find solutions to the exercises in the reader comments). Or did you consider those "ridiculous" tutorials as well?

>I'm still trying
>to figure out what all those combinators are about! And it is all
>rested 
>on mathematical proofs, usually inductive.
>
>And that is just the lambda calculus aspect. Then we move on to type 
>theory (!!!) plus the various types of polymorphism, and then on to a 
>number of other topics that I don't know enough about to even mention 
>intelligibly.

Yup, I'm still trying to get a handle on that myself. You can get to functional programming without going through that,though. I think I'm going to need those combinators to make the best of Haskell, and I suspect I'll need the math to understand those. But Haskell's large collection of combinator libraries are really no worse than any modern language's library collection (do you "get" all of cpan or pypi or ... ?). That there's a firm mathematical basis behind them just makes them more fun to learn.

     <mike

-- 
Sent from my Android tablet with K-9 Mail. Please excuse my brevity.



More information about the Beginners mailing list