![]() | ![]() | ![]() | Exercise 3 - Operations over functions | Documentation and user's manual | Table of contents | OCaml programs |
|
First consider mathematics.
Let f and g be functions that map real numbers to real numbers. Then f+g denotes the function that maps x to f(x)+g(x) and is called the sum of f and g. Similarly f g denotes the function that maps x to f(x) g(x) and is called the product of f and g. Now consider programming. Use Is Write applications of Write applications of results of applications of each of them. |
|
Using accumul_right and product write the functional value that computes the product of all the elements in a list of function mapping real numbers to real numbers.
Write applications of this functional value. Write applications of results of such applications. |
|
Now climb up in abstraction.
Look at the definitions of Identify what is identical in them and what is not. Then transform what is identical into a functional value that can be applied to obtain the value of Write the type of |
|
Write applications of phi whose results are the values of sum and of product .
Write another application of |
![]() | ![]() | ![]() | Exercise 3 - Operations over functions | Documentation and user's manual | Table of contents | OCaml programs |