*. x -. x -. 1.) 3.;; - : float = 26. The correct answer is . The function is called a "higher-order function" because it accepts another function () as an argument. We can go further and create the (approximate) derivative of f, by applying while omitting the argument: # let f' = d (fun x -> x *. x *. x -. x -. 1.) ;; val f' : float -> float = <fun> The concepts of curried and higher-order functions are clearly useful in mathematical programs. In fact, these concepts are equally applicable to most other forms of programming and can be used to factor code much more aggressively, resulting in shorter programs and fewer bugs. Discrete wavelet transform (pattern matching) The 1D Haar wavelet transform of an integer-power-of-two-length list of numbers can be implemented very succinctly in Caml and is an excellent example of the use of pattern matching over lists, taking pairs of elements ( and ) off the front and storing their sums and differences on the lists and , respectively: # let haar l = let rec aux l s d = match l, s, d with [s], [], d -> s :: d | [], s, d -> aux s [] d | h1 :: h2 :: t, s, d -> aux t (h1 + h2 :: s) (h1 - h2 :: d) | _ -> invalid_arg "haar" in aux l [] [];; val haar : int list -> int list = <fun> For example: # haar [1; 2; 3; 4; -4; -3; -2; -1];; - : int list = [0; 20; 4; 4; -1; -1; -1; -1] Pattern matching allows complicated transformations to be represented clearly and succinctly. Moreover, the Caml compiler turns pattern matches into very efficient code, at times resulting in programs that are shorter and faster than equivalent code written with a case statement (Cardelli 1984, p. 210.). History The first Caml implementation was written in Lisp by Ascánder Suárez in 1987 at the French Institute for Research in Computer Science and Automation (INRIA). Its successor, Caml Light, was implemented in C by Xavier Leroy and Damien Doligez, and the original was nicknamed "Heavy Caml" because of its higher memory and CPU requirements. Caml Special Light was a further complete rewrite that added a powerful module system to the core language. It was augmented with an object layer