tail_sum() should have
$running_total set to 1 by default instead of 0.
$x has incorrect return type
$x should return a type of
Only and not an integer as defined in the book. So
$x should be:
Therefore the return types of
$b (declared in the same code block as the definition of
$x in the book) now need to be updated to match as well.
Note the changes to the comments so that it now indicates a return value of
$y definition missing
The definition of
$y was missing from the book and should be:
With this in place the third law is now provable.
Maybe monad shouldn't overload
map() should be defined as:
Then we need to add another method to the class to allow for the additional functionality.
Finally this means that the call applying
$verify_names must also be amended on the base of page 88.