Known errors in Introducing ReScript 12, second edition, by printed page number. Found something that isn't here? Let me know.
p. 80 — the guard in matchRecord4 should use if, not
when:
| {name: n} if String.length(n) > 10 => true
p. 87 — manhattan2 should use Math.Int.abs rather
than a bare abs. (Math.abs on p. 86 is correct; that example uses
floats.)
p. 92 — “by having Array.get returns an optional
value” should read “return an optional value.”
p. 104 — Array.partition is in the standard library as of
ReScript 12.2. Disregard the note saying it is Belt-only.
p. 157 — ArrayStack.peek is missing its if. Since
array access already returns an option, the check can go entirely:
let peek = stack => stack[Array.length(stack) - 1]
p. 175 — TAG holds the constructor name as a string, so the two
compiled listings should read TAG: "Player" and TAG: "Enemy". The raw
JavaScript and console output on those pages are already correct.