[October 2017: More OCaml has been reprinted to reflect language changes in OCaml. See the blog entry for more details.]

To the first printing of "More OCaml", 2014

Page 9, for "x is new, and is false" read "x is new, and is true"

Page 32, for "let putbit o b" read "let rec putbit o b"

Page 32, for "if b <> 1 then o.obyte <-", read "if b <> 0 then o.obyte <-"

Page 42, correct the white terminating codes for lengths 1,8,22,48,60 and the black terminating code for 48, by reference to examples/Chapter6 in the download.

Page 44, insert the function "peekbit" from the exercises download. It is referenced but not defined.

Page 46, in the "encode_fax" function, replace "(code true 0)" with "(code false 0)"

Page 94, "empty : turn -> bool" should be "empty: turn -> int list" 

Page 185, Figure A.5, for "if Buffer.length b = 0 String.length word > width" read "if Buffer.length b = 0 && String.length word > width"

To the sixth printing of “OCaml from the Very Beginning”, 2017

Page 167 for “if a <> [||]” read “if Array.length a > 1”. For “Array.length a / 2” read “Array.length a / 2 - 1”. Delete paragraph following code of array_rev.

To the fourth printing of "OCaml from the Very Beginning", 2015

Page 84, add a closing parenthesis after ""two"), Lf, Lf)" and remove one from the end of that line.

Page 101, for "until the boolean condition is true" read "until the boolean condition is false"

Page 101, for "...reference t is greater than x" read "...reference t is greater than or equal to x"

Page 114, in Q3, for "integer and whole" read "whole and fractional"

To the third printing of "OCaml from the Very Beginning", 2014

page 27: for "h is the head, t is the tail", read "_ is the head, t is the tail"

page 63: The "rec" keyword in the "key_exists" definition is not necessary

Page 85, for "dependant" read "dependent"

Page 86, Question 3. The naive solution in fact has a general enough type, so the question is misleading. The answer to this question gives the wrong type for the first version.

Page 89, for "no longer depends" read "may no longer depend"

page 104: "In contrast to finding the length of an array" should read "In contrast to finding the length of a list"

page 150: solution to problem 4: (a' list x b' list) -> (a' x b') list should be (a' x b') list -> (a' list x b' list)

page 170: problem 5: ... and then loop until the we are outside the range" - delete "the"

 

To the second printing of "OCaml from the Very Beginning", October 2013:

Page 78, for "widest" read "narrowest"

Page 102, for "file_statistics_channel channel" read "channel_statistics channel"

Page 142, for "rev_inner (h :: a) l" read "rev_inner (h :: a) t"

Page 154-155, the truncate function should call truncate_l in both solutions.

 

To the first printing of "OCaml from the Very Beginning", June 2013: 

Page 12, for "gcd 64000 3546" read "gcd 64000 3456"

Page 26, insert parentheses to clarify evaluation order: 

1 + (1 + length [5; 5]) , 1 + (1 + (1 + length [])), 1 + (1 + (1 + 0)), and 1 + (1 + (1 + ...

Page 30, for "h::t -> h :: take (n - 1) l" read "h::t -> h :: take (n - 1) t" 

Page 39, for "by found by" read "be found by" 

Page 68, for "map (map f))" read "map (map f)"

Page 82, replace '=' with '->' in the match cases for size, total, and max_depth

Page 124, for "int * int * int = (0, 0, 0, 0)" read "int * int * int * int = (0, 0, 0, 0)" 

Page 137, for "match 1 + 1 with =" read "match 1 + 1 with" 

Page 139, in "count_true" for "[] -> []" read "[] -> 0"

Page 173, for "0.22s" read "0.022s" 

 

Thanks to all those who took the time to point these out.