[Haskell-cafe] I read somewhere that for 90% of a wide class of computing problems, you only need 10% of the source code in Haskell, that you would in an imperative language.

Andrew Coppin andrewcoppin at btinternet.com
Thu Oct 1 03:53:53 EDT 2009

John Dorsey wrote:
>> Well, try this: Go ask a random person how you add up a list of numbers.  
>> Most of them will say something about adding the first two together,  
>> adding the third to that total, and so forth. In other words, the step  
>> by step instructions.
> You word the (hypothetical) question with a bias toward imperative
> thinking.  You're asking "How do you do this action?"
> Why isn't the question "What is the sum of a list of numbers?", which is
> biased toward the declarative?

Sure. But what is a computer program? It's a *list of instructions* that 
tells a computer *how to do something*. And yet, the Haskell definition 
of sum looks more like a definition of what a sum is rather than an 
actual, usable procedure for *computing* that sum. (Of course, we know 
that it /is/ in fact executable... it just doesn't look it at first sight.)

Whatever; I'm leaning more and more towards the concept that FP is only 
hard for people who already learned some other way...

More information about the Haskell-Cafe mailing list