Re:Why did Microsoft invest so much in F#?
by timrobinson on Monday November 08, 2010 @06:24PM
(#1884494)
dict.TryGetValue is an odd example here -- idiomatic F# for a map lookup would be:
let value = defaultArg (Map.tryFind "foo" dict) "default"
or match Map.tryFind "foo" dict with
| Some v -> v
| None -> "default"
groan
or (and for anybody who wants to whine about parameters order, please remember — or discover — that partial application is extremely frequent in Haskell and MLs, and try to read the parameters order in this light, you will be enlightened)