I’m reading the book ‘Beginning F#’,
There’s a short list for example code, to demonstrate the lazy evaluation as follows:
lazyValue = lazy ( 2 + 2 )
let actualValue = Lazy.force lazyValue
printfn "%i" actualValue
It seems easy, but there’s a error to me, say that function force isn’t defined???
I’m confused about that. Searching from the msdn, it seems no answer.
Anyone can tell me what happened??
For some reason, Lazy.force is in F# PowerPack now.
Since this function doesn’t have dependency, I suggest you to copy it from F# PowerPack for convenient use: