Skip to content

Instantly share code, notes, and snippets.

@simonhdickson
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simonhdickson/562b0562878b3ac27ae3 to your computer and use it in GitHub Desktop.
Save simonhdickson/562b0562878b3ac27ae3 to your computer and use it in GitHub Desktop.
let (|MyPattern|_|) (|Number|_|) = function
| Number 1 -> Some MyPattern
| _ -> None
let doSomething = function 1 -> Some 1 | _ -> None
match 1 with
| MyPattern doSomething -> ()
| _ -> ()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment