Errata

Humans are people too; we all make mistakes from time to time. Here are some mistakes that got through in the print edition of Learn You a Haskell.

Believe the Type

Page 25: So if you have a 64-bit CPU, it’s likely that the lowest Int on your system is -263, and the highest is 263
Actually the highest is probably 263 - 1. Whoops!

Monoids

Page 252:: The Monoid type class is defined in import Data.Monoid
Should be: The Monoid type class is defined in Data.Monoid

Page 253:: That’s why when making monoid instances, we need to make sure they follow these laws
Should be: That’s why when making Monoid instances, we need to make sure they follow these laws

A Fistful of Monads

Page 273:: When feeding the Maybe a to our function, we keep in mind the context and return a Nothing if the value on the left is Nothing Again, if there’s no value, then there’s no way to apply our function to it
The dot is missing in the end of the sentence “if the value on the left is Nothing

Page 283:: So we explicitly pass the previous Pole to the landLeft landRight functions
Should be: So we explicitly pass the previous Pole to the landLeft and landRight functions

Page 292:: As an exercise, you can change this function so that when you can reach one position from the other, it tells you which move to take
Should be: Which moves to take

For a Few Monads More

Page 301:: Milk costs 25 cents, but if we have it with beans that cost 25 cents, we’ll end up paying 35 cents
Should be: beans that cost 10 cents

Page 303:: For String, the monoid value is the empty string.
Should be: For String, the identity value is the empty string.

Page 308:: Notice how for lists, mempty is just the id function, and mappend is actually just function composition.
Should be: Notice how for difference lists, mempty is just the id function, and mappend is actually just function composition.

Page 315:: We take a stack, and then we do push 1 stack
Should be: We take a stack, and then we do push 3 stack