Skip to content

Instantly share code, notes, and snippets.

@SteveGilham
Created April 26, 2015 14:16
Show Gist options
  • Save SteveGilham/254b04aa9c8afec51ae1 to your computer and use it in GitHub Desktop.
Save SteveGilham/254b04aa9c8afec51ae1 to your computer and use it in GitHub Desktop.
Parse A or B (continuation based)
// (^^) associates on the right, which means that we can chain instances without requiring nested brackets
let ( ^^ ) (test, g1) (g2: 'x -> continuation) x =
(if test x then g1 else g2) x;;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment