Differences between version 2 and previous revision of HigherOrderFunctions.
Other diffs: Previous Major Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 2 | Last edited on Tuesday, June 3, 2003 11:43:37 pm | by GlynWebster | Revert |
Older page: | version 1 | Last edited on Monday, February 24, 2003 4:33:18 pm | by GlynWebster | Revert |
@@ -1,13 +1,13 @@
Higher-order functions are functions that take other functions as parameters, create functions or return functions.
-The use of higher-order functions with PolymophicTypes
results in a style of programming that rivals ObjectOrientedProgramming for expressiveness.
+The use of higher-order functions with PolymorphicTypes
results in a style of programming that rivals ObjectOrientedProgramming for expressiveness.
[ML], [Haskell], [Lisp], [Python] all allow full use of high-order functions. [C] allows you to pass functions as arguments, but their usefulness is rather limited.
!!!An Example
-(This follows on for
the the example in PolymophicTypes
.)
+(This follows on from
the the example in PolymorphicTypes
.)
Glyn want make new trees from old ones by changing the leaves. So he writes a function to do this for him. One of its parameters will be a function that takes the value of a leaf and returns the changed value.
# __let rec__ map change tree =