The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Really? I thought it was the other way around: side-effect-free programming makes it possible program in a fully functional way, because side-effect-free functions live "outside of time" just like numbers. So it seems to me that what you call "functional techniques" is very much the point of Haskell. I'm just learning about Haskell, but it is already clear to me that Haskell invests a lot of effort on making functions really first class: it lets you not only pass them to and from other functions (just like Perl does), but also provides built-in operators and other syntactic constructs for easily creating new functions and operators from existing ones. Here are some examples of what I mean. The dot is the composition operator: f . g is the function that when applied to its arguments, say x, y, z, returns the result of applying f to g x y z. Or curried functions: if f is a functions of two arguments, f x is the function of one argument that when applied to y returns f x y. Or sections: if op is a binary infix operator, then (x op) is the function of one argument that when applied to, say, y returns x op y. One can treat f.g, (f x), and (x op) just like any other function, including passing them to other functions and operators as arguments, etc. Most of these operations on functions can be mimicked in Perl, but my point is that with Haskell one gets the message that these function-oriented facilities are really central to the goals of the language. the lowliest monk In reply to Re^2: If not 'Functional Programming', then what?
by tlm
|
|