Created
March 26, 2014 22:17
-
-
Save NickLydon/9794923 to your computer and use it in GitHub Desktop.
This file contains 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 splitIncludesAndExcludes = | |
searchPatterns |> | |
Seq.fold(fun (acc,collecting) next -> | |
match next with | |
| IncludeKey -> (acc, Include) | |
| ExcludeKey -> (acc, Exclude) | |
| next -> | |
match collecting with | |
| Skip -> (acc, collecting) | |
| Include -> | |
({ acc with Includes = next::acc.Includes }, Include) | |
| Exclude -> | |
({ acc with Excludes = next::acc.Excludes }, Exclude)) | |
({ Includes = []; Excludes = []; }, Skip) | |
|> fst |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment