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.

i-cjw (1) [Avatar] Offline
#1
Hi - firstly, thank you for putting together FP for the Real World - I'm finding it a great tool to get into F#. I found an few issues with the latest version:

Listing 6.22:
> [ 1 .. 5 ] |> List.fold_left (*) 5
val it : int = 120
resulting value is 600. [ 1 .. 5 ] |> List.fold_left (*) 1 produces 120

Listing 7.14:
let main = new Form(Text = "Document", BackgroundImage = img
missing comma after img

Listing 8.4:
{ Name : string; Income : int; YearsInJob : int
missing semi-colon after int

Listing 8.12:
> let lessThanTest f min property =
let report cl =
printfn "Checking '%s' of '%s' failed (less than %d)!"
property cl.Name (f(cl)) min
{ Test = (fun cl -> f(cl) < min)
Report = report };;
should be
> let lessThanTest f min property =
let report cl =
printfn "Checking '%s' of '%s' failed (less than %d)!"
property cl.Name min // change
{ Check = (fun cl -> f(cl) < min) // change
Report = report };;

Listing 12.4:
I couldn't figure out why factorials was declared as recursive. Leaving out the rec seems to work just as well:
let factorials = factorialsUtil(0, 1)

Listing 12.10
map_concat is now collect

Listing 13.4
Async.Primitive construct is deprecated - I can't figure out what to use instead smilie

Listing 13.5
Worldbank has changed their API, but the prior one still works with the addition of /v1 to the url:
yield "http://open.worldbank.org/v1/rest.php?per_page=100"
etc

That's all so far. Looking forward to getting the final version!