F# method to insert, update, or delete events in a dictionary I have the following code:

    member this.ProcessEvent(sourceStream: OrderResponse) =          
       match sourceStream.Action with
        | Action.Partial
        | Action.Insert -&gt;
            sourceStream.Data
            |&gt; Seq.iter (fun x -&gt; this.orderState.[x.OrderId] &lt;- this.ConvertFullOrder x)
        | Action.Update -&gt;
            sourceStream.Data
            |&gt; Seq.iter (fun x -&gt; this.orderState.[x.OrderId] &lt;- this.UpdateOrder x this.orderState.[x.OrderId])
        | Action.Delete -&gt;
            sourceStream.Data
            |&gt; Seq.iter (fun x -&gt; this.orderState.Remove(x.OrderId) |&gt; ignore)
        | _ -&gt; ()


It is processing a list of events and an action. The data is processed and stored in a dictionary. The action tells to insert, update or delete some of the records and applies to all the events received in the same message.

For each case, I iterate through the sourceStream.Data list.

Is there a better / more readable way where I can declare I am going to process that list and then, based on the Action, have different code? this would allow to remove the multiple sourceStream.Data |&gt; bits and specify it only once.
You have probably found a good solution long time ago, but here is my suggestion:
member this.ProcessEvent(sourceStream: OrderResponse) =          
    let handler: (Order -&gt; unit) = 
        match sourceStream.Action with
        | Action.Partial
        | Action.Insert -&gt; (fun x -&gt; this.orderState.[x.OrderId] &lt;- this.ConvertFullOrder x)
        | Action.Update -&gt; (fun x -&gt; this.orderState.[x.OrderId] &lt;- this.UpdateOrder x this.orderState.[x.OrderId])
        | Action.Delete -&gt; (fun x -&gt; this.orderState.Remove(x.OrderId) |&gt; ignore)
        | _ -&gt; (fun x -&gt; ())

    sourceStream.Data |&gt; Seq.iter handler

I'm not sure. what type x has, so for the illustration I just call it Order in the handler definition.