ERRATA IN "ML for the Working Programmer", 3rd printing

** Chapter 3 **

73, line 16 (Allen Stoughton): 505,000 should be 500,500

[91, 92: Note that the result of the depth-first search appears in reverse
order.  Perhaps the display should use "rev(depthfirst ...)"??]

** Chapter 4 **

125, line -3: "Function" should be lower case.  

[133-136: A. C. Norman has found a much simpler and faster version of
heap sort.  Unfortunately, it seems unsuitable for priority queues...]

** Chapter 5 **

** Chapter 6 **

215, Exercise 6.24 (Silvio Meira): f has to be associative and that e needs
to be a left identity.  Could insert "Let $\odot$ be as in the
previous exercise." and replace f by (\ttb{op}\odot).

- fun exercise e f =
=   let fun h xs = foldright f (xs,e)
= in fn xss => [foldright (foldright f) (xss,e), foldright f (map h xss, e)]
= end;
val exercise = fn : 'a -> ('a * 'a -> 'a) -> 'a list list -> 'a list
- exercise "." op^ (map explode ["not","quite","right"]);
val it = ["notquiteright.","not.quite.right.."] : string list

\exercise Suppose that $\odot$ and $e$ satisfy, for all~$x$, $y$ and~$z$,  
$$  x \odot (y\odot z) = (x\odot y) \odot z   \quad\hbox{and}\quad
    e \odot x = x.$$
Let $F$ abbreviate $foldright\,(\ttb{op}\odot)$.
Prove that for all $y$ and $l$,
$$ F(l,e)\odot y = F(l,y) \, .  $$ 

\exercise Let $\odot$, $e$ and $F$ be as in the previous exercise.  
Define the function $h$ by $h(l) = F(l,e)$.  Prove that for all $ls$,
$$ foldright\, F\, (ls,e) = F(map\,h\,ls, e).  $$

** Chapter 8 **

[306, Line -6 (Mike Gordon). Is the response to "print(sqrt 2.0)"
correct? (a) The value of print(x) is NOT x under New Jersey ML. 
(b) No compiler prints exactly what's shown in the text, e.g. they include
val it = ".]

** Chapter 9 **

312 [Reuben Thomas]: penultimate line: Block(es,indent... should be 
Block(es, indent...

317 [Reuben Thomas]: change _ in first line of drop to n

320 [Reuben Thomas]:    \,   should be   \\,
In the source   \ttbacksl,   should be   \ttbacksl\ttbacksl,
Or else perhaps most of the line should be enclosed in \verb9...9

342 [Reuben Thomas]: fun makelambda would more consistently finish with a
;. In the definition of term, first( needs a space before it.

344 [Reuben Thomas]: the second line of applic seems oddly tabbed: close up

409 [Andrew Morris] Add to Bibliography before Oppen:

\bb F. Oppacher \& E. Suen (1988).
HARP: A tableau-based theorem prover.
{\it Journal of Automated Reasoning}, 4:69--100.

**** Syntax diagram errors found by Gary Leavens ****

There is no way to get out of Specification (on page 413), Declaration
(page 414), and Datatype Binding (on 415).  Add a downwards-pointing arrow
on the right side of each.

