Skip to content

Instantly share code, notes, and snippets.

@moiseev
Created February 5, 2010 09:01
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 moiseev/295662 to your computer and use it in GitHub Desktop.
Save moiseev/295662 to your computer and use it in GitHub Desktop.
let foldClause simpleF complexF clause =
let unitem = function
| Prop ss -> ss
let rec loop clause cont =
match clause with
| Simple (item, condition, value) ->
cont (simpleF (unitem item) condition value)
| Complex (l, op, r) ->
loop l (fun lval ->
loop r (fun rval ->
cont (complexF lval op rval)))
loop clause id
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment