Skip to content

Instantly share code, notes, and snippets.

@moiseev
Created February 5, 2010 09:04
Show Gist options
  • Save moiseev/295665 to your computer and use it in GitHub Desktop.
Save moiseev/295665 to your computer and use it in GitHub Desktop.
type IClauseVisitor<'TState> =
abstract member Simple : String array * Condition * Val -> 'TState
abstract member Complex : 'TState * LogicalOperation * 'TState -> 'TState
let visitClause (visitor:#IClauseVisitor<'TState>) clause =
let simpleF props (cond:Cond) value = visitor.Simple(props, (cond.ToEnum()), value)
let complexF left (logOp:LogOp) right = visitor.Complex(left, (logOp.ToEnum()), right)
Clause.Fold simpleF complexF clause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment