|
![]() |
||||||||||||||
Program Structure TutorialHigher Order FunctionsOne of essential properties of functional programming languages is that functions are treated as first order citizens. Functions can be used as arguments and results of other functions. In the following simple example, a function is used as argument of another function application. More complex examples follow later. Source code:apply(double,2) where{ apply(f,x) = f(x); double(x) = x + x; } Result:4
|
|
||||||||||||||
© 2006 Saša Malkov | |||||||||||||||