[Haskell-cafe] How to do this in FP way?

Andrew Coppin andrewcoppin at btinternet.com
Mon Jun 16 15:46:16 EDT 2008


David Roundy wrote:
>
> A better question would be to think about what you are trying to
> accomplish, and then ask how to achieve that through functional
> programming.
>   

Amen!

I was waiting for somebody to say that...

There are a dozen situations in an imperative language where you'd write 
a loop. But in Haskell, you might well do something entirely different 
for each situation. So it really pays to focus on what the end result 
you're after is, rather than how to translate imperative code 
line-for-line into Haskell.



More information about the Haskell-Cafe mailing list