Errata

Programming F# 3.0

Errata for Programming F# 3.0

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
PDF Page 19
Table 2-4

First line of table has this in the "Description" field: Converts data to an sybte. I believe there is a typo there, with the sybte actually meaning sbyte.

Sam Zaydel  Dec 24, 2014 
PDF Page 39
Last paragraph

The sentence reads:

"It provides an elegant way for you to transform although used repeat?
edly, can simplify the structure of code you write."

The gist of the phrases is clear but they don't form a complete thought.

Anonymous  Jul 13, 2013 
Printed Page 57
Example code, powerOfTwo example

Looking at the code, we have the following:

val powerOfTwo = generatePowerOfFunc 2.0;;

I typed that into the REPL, and it gives an error regarding the type val. I'm pasting my entire REPL below:



> let generatePowerOfFunc baseValue = (fun exponent -> baseValue ** baseValue)
;;

val generatePowerOfFunc : baseValue:float -> exponent:'a -> float

> let powerOfTwo = generatePowerOfFunc 2.0 ;;


/Users/dthole/Programming/programming-fsharp-3.0/ch03/funretfunctions.fs(13,5): error FS0030: Value restriction. The value 'powerOfTwo' has been inferred to have generic type
val powerOfTwo : ('_a -> float)
Either make the arguments to 'powerOfTwo' explicit or, if you do not intend for it to be generic, add a type annotation.
>

David Thole  Jun 09, 2015 
Printed Page 216
Top code sample

The pickItem comparison function shown produces the inverse result from the previous page. To produce the same results the comparison should be:

match cmp acc item with
| true -> item
| false -> acc

rather than what is printed which is

match cmp acc item with
| true -> acc
| false -> item

John Golding  Feb 07, 2018