The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Susan Harkins (424) [Avatar] Offline
Please post errors in the published version of The Little Elixir & OTP Guidebook here. We'll publish a comprehensive list for everyone's convenience. Thanks!

Susan Harkins
Errata Editor
Steven Leiva (14) [Avatar] Offline
Susan - by "here" do you mean as a reply to this topic, or as a new topic to the book's forum?
Susan Harkins (424) [Avatar] Offline
Anywhere in the forum is Okay -- we will find it. But, I do like to encourage everyone to post errors in the same discussion. Thank you!

Susan H.
Ethan Sherbondy (2) [Avatar] Offline
Little issue with missing closing paren on pg 79 of listing 4.15:

GenServer.cast(@name, :reset_stats
Ethan Sherbondy (2) [Avatar] Offline
Found another little typo on pg. 121, section 6.2.5. I think the author meant to refer to
rather than

If you're supervising a Supervisor then use supevise/3
edennis (1) [Avatar] Offline
The example of MyList.flatten/1 on page 32 in the final version is incorrect. It starts with step #2 in the description:

"The second function clause C matches. In this case, you pattern-match the list:
head is [1], and tail is 2. Now, flatten([1]) and flatten(2) are called

It should read:

"The second function clause C matches. In this case, you pattern-match the list:
head is [1], and tail is [2]. Now, flatten([1]) and flatten([2]) are called

The description of step #4 should also be changed to reflect this as it currently doesn't correctly describe the flow of the program.
Susan Harkins (424) [Avatar] Offline
Daniel Matysiak (10) [Avatar] Offline
In section 1.5.4 (pg. 12), the property test contains a string that says "reverse is idempotent". This is not the case. An idempotent operation f satisfies the equality f(f(x)) = f(x). Reverse is it's own inverse, i.e., f(f(x)) = x.
Daniel Matysiak (10) [Avatar] Offline
Error in section 2.5.3, p. 25:

"This should come in handy when you're only interesting in extracting [...]"

"interesting" should be "interested".
nik_a (3) [Avatar] Offline
Listing 8.11 prematurely includes `nodes` as the second argument to `process_options`. Nodes don't appear until 8.14/8.15.
nik_a (3) [Avatar] Offline
Figure 8.4, typo in `Tasks.Supervisor`
456927 (1) [Avatar] Offline
Section 5.1.7 Exit Messages

The example is missing the step to trap exits. In order to be able to flush the exit message from the shell process, I needed to add this step:

Process.flag(:trap_exits, true)
alamba78 (17) [Avatar] Offline
Ethan Sherbondy wrote:Found another little typo on pg. 121, section 6.2.5. I think the author meant to refer to
rather than

If you're supervising a Supervisor then use supevise/3

It's odd that supervisor/3 isn't mentioned till later on in the chapter after Pg. 121.
421407 (2) [Avatar] Offline
Listing 5.11

The 3-element tuple message sent in this GenServer call from the public restart_child/3:, {:restart_child, pid, child_spec})

Does not match the 2-element tuple message in the handler callback function:
def handle_call({:restart_child, old_pid}, _from, state) do

This error also exists in the source code on github at the time of this writing.

And the public ThySupervisor.restart_child/3 does not match the signature of Supervisor.restart_child/2 in the Elixir stdlib documentation (which I think is the source of the confusion/error).
355012 (1) [Avatar] Offline
bug in page 153 section 7.1.9. The handle info function for :EXIT message should use the worker_sup and not the pool_sup to restart a new child when it dies.
yogi (1) [Avatar] Offline
Listing 4.13, the module name IO is missing from the call to inspect/1
452736 (1) [Avatar] Offline
I haven't checked my paperback copy (which someone is borrowing), but my pdf and kindle version have this error on page 72:

defp url_for(location) do

The URL should be "", without the "b"
Jaime Iniesta (4) [Avatar] Offline
In page 146 of the PDF, 7.1.5, it says:

When Pooly.PoolsSupervisor starts, it starts up individual Pooly.PoolSupervisors that in turn start their own Pooly.Server and Pooly.WorkerSupervisor (see figure 7.4).

I think it should not be
, but
Jaime Iniesta (4) [Avatar] Offline
In 8.2.3, after the Listing 8.2, it says:

"The start function takes a url and an optional func."

But the listing 8.2 does not accept this optional function
Jaime Iniesta (4) [Avatar] Offline
Also in 8.2.3,

"The HTTP request function is then invoked in the body of Time.measure/1"

It's "Duration.measure/1" what's in the listing.
Jaime Iniesta (4) [Avatar] Offline
In 8.3, the Task.async example needs to add the caller argument, or roll back the changes introduced for the Caller - the thing is that if you follow along, the code does not work.
345042 (8) [Avatar] Offline
With regard to the listing for 5.11, which was mentioned earlier, the call in the API needs to drop the ref to child_spec in the call to restart_child, but unfortunately that leaves two definitions for restart_child/2, so one of them needs to be renamed. I just used restart_chld (probably could have done better) for the private function.

In any case, with those changes it works.

But the specs say:
The child specification must exist and the corresponding child process must not be running.

which means that the call to terminate_child in the private def is not what would be needed in a real supervisor.
538473 (2) [Avatar] Offline
Typo: Page 72, Listing 4.6 in the def url_for
The listing has:
should be:

No "b"
Susan Harkins (424) [Avatar] Offline
An updated errata list for The Little Elixir & OTP Guidebook is available at Unless otherwise noted, corrections have been made to the pbook and are pending for mobile and livebook versions. Thank you for participating in the collection process. Your contributions are a great help to us and other readers.

Susan Harkins
Errata Editor