This will simplify your life if you define an Adapter for TryGetValue , which is more like F #:
let tryGetValue k (d : Dictionary<_, _>) = match d.TryGetValue k with | true, v -> Some v | _ -> None
With this, you can now define the buy function as follows:
let buy key limit = price |> tryGetValue key |> Option.map ((>=) limit) |> Option.exists id
This gives the desired result:
> buy "apple" 7;; val it : bool = true > buy "orange" 7;; val it : bool = false > buy "banana" 7;; val it : bool = false
source share