Skip to content

Instantly share code, notes, and snippets.

@gsg
Created Sep 18, 2016
Embed
What would you like to do?
type instruction =
| Order of {id: int; price: float; size: int}
| Cancel of {id: int}
| Cancel_replace of {id: int; new_price: float; new_size: int}
let filter_by_oid instructions oid =
List.filter (function
| Order o -> o.id = oid
| Cancel c -> c.id = oid
| Cancel_replace cr -> cr.id = oid)
instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment