I have a Dictionary over which I initially iterated thusly:

myDictionary |> Seq.iter (fun kvp -> doSomething kvp.Key kvp.Value)

Later, I discovered that I could make use of the KeyValue active pattern, and do this:

myDictionary |> Seq.iter (fun (KeyValue (k, v)) -> doSomething k v)

Knowing that active patterns aren't some form of preprocessor directive, how am I able to substitute the kvp argument in the lambda for a function that decomposes it?

Edit
Report