Created
December 17, 2010 01:06
-
-
Save mikeobrien/744315 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let GetUnionExpressions<'a> expression = | |
let getVisitorExpressions expression = | |
let unionVisitor = new UnionVisitor<'a>() | |
unionVisitor.Visit(expression : Expression) |> ignore | |
unionVisitor.Expressions | |
let rec getUnionExpressions (expressions : seq<UnionVisitor<'a>.UnionExpression>) = | |
if expressions |> Seq.isEmpty then Seq.empty | |
else expressions | |
|> Seq.collect (fun x -> x.Expression |> getVisitorExpressions |> getUnionExpressions) | |
|> Seq.append expressions | |
expression |> getVisitorExpressions |> getUnionExpressions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment