Skip to content

Instantly share code, notes, and snippets.

@chrisalexander
Created January 28, 2017 15:09
Show Gist options
  • Save chrisalexander/3e0cb6ba807e95d48c1cad792b5fa28c to your computer and use it in GitHub Desktop.
Save chrisalexander/3e0cb6ba807e95d48c1cad792b5fa28c to your computer and use it in GitHub Desktop.
// Arbitrary function
let doValidate x =
x > 3
// Arbitrary execution function
let doExecute x = 0
// Validate and return function to execute
let validate x =
match doValidate x with
| true -> Some (fun () -> doExecute x)
| false -> None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment