Skip to content

Instantly share code, notes, and snippets.

@gsg
Created September 18, 2016 10:18
Show Gist options
  • Save gsg/8c3d4ad005a7584a369a6db2fb6925c6 to your computer and use it in GitHub Desktop.
Save gsg/8c3d4ad005a7584a369a6db2fb6925c6 to your computer and use it in GitHub Desktop.
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