Perl: the Markov chain saw | |
PerlMonks |
Re: RFC: A Perlesque Introduction to Haskell, Part One (DRAFT)by tmoertel (Chaplain) |
on Jun 24, 2004 at 04:28 UTC ( [id://369243]=note: print w/replies, xml ) | Need Help?? |
First, great introduction. Keep it
coming!
I write a fair bit of software in Haskell, and so I hope you won't mind a few suggestions. I'm numbering them to coincide with your section numbering. 1.1 You might want to make mention of higher-order functions, i.e., functions that operate on functions. It's implied by your description of first-class functions, but it's such an important part of functional programming that you might want to call more attention to it. 1.2 I don't find the comparison of Haskell's type system to that of C++ or Java's to be accurate. C++ and Java's type systems bring to mind "bondage and discipline" and require annoying, redundant type declarations all over the place. In Haskell, you are for the most part unshackled and can program without type annotations, reserving them for the few places where they add documentation value (or are needed to avoid ambiguity), and yet you still get their full benefit in all of your code. 2.5 You're not canceling free variables but rather bound variables. This canceling is commonly called "eta reduction." (The opposite is "lambda lifting.") Also, your definition of any is actually that of or. Likewise, your all is actually and. The any and all functions in the Prelude take a predicate as their first argument and a list as their second. You probably meant the following:
Cheers,
In Section
Meditations
|
|