Ryan Riley (17) [Avatar] Offline
#1
Not sure how you got 120, but the result of [ 1 .. 5 ] |> List.fold (*) 5 is 600 every way I tried it. Also, and I'm sure you know this, fold_left is now fold in the latest version of F#.
Tomas Petricek (160) [Avatar] Offline
#2
Re: 6.7.3, Page 170, Incorrect return value
Hi,
thanks for reporting this - you're right the listing is wrong. I wanted to write the folding with 1 as the initial value (I'm not sure how "5" appeared there):

>> [ 1 .. 5 ] |> List.fold (*) 1

Regarding fold_left - yes, that's deprecated with F# "beta 1". I'm just updating all the source code for this version, so this is corrected in the manuscript now.

Thanks (and thanks for your other posts too - I'll eventually get to all of them).
Tomas