Errata ([Version française])




Page 31, section 1.5.2, first paragraph:
Read: Caml discovers that to compose f and g, it is necessary and sufficient for the range of g and the domain of f to coincide.


Page 69, exercise 2.8:
The second sentence should read: Define a Caml type for a representation that suppresses null terms.


Page 64, insertion sort should be defined as:

let sort order xs = list_it (insert order) xs [];;


Page 69, exercise 2.9:
The second sentence should read: Write a function that computes the set of values from a tree of this type (the set of elements held in the leaves of the tree).


Page 88, section 3.2.1:
Missing rules specifying that constants and recursive terms are values. The two following rules (axioms) should be added:
      -----------(Const)
|- c => c

   ----------------------(Rec)
|- (Rec f) => (Rec f)
Page 88, section 3.2.2:
In rule (App2), one may think that tuple components need to be evaluated before being passed as arguments to a function. This is because metavariable v is used instead of e. The (App2) rule is clearer if written as:
|- e1 => (fun (x1, ..., xn) -> e)    |- e2 => (e'1, ..., e'n)   |- e[xi <- e'i ] => v
     ----------------------------------------------------------------------------------(App2)
|- e1 e2 => v
Page 102, exercise 3.1:
The function iter1 should be written as:
let rec iter1 n f =
  if n=0 then (fun x -> x) else compose f (iter1 (n-1) f);;


Back to the book's home page.