Skip to content

Instantly share code, notes, and snippets.

@adamchester
Created June 21, 2014 02:36
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 adamchester/2243f287d4b64573cda0 to your computer and use it in GitHub Desktop.
Save adamchester/2243f287d4b64573cda0 to your computer and use it in GitHub Desktop.
Except
let whereNotExistsIn itemsToExclude itemToTest =
itemsToExclude |> Seq.exists (fun j -> itemToTest = j) |> not
let except itemsToExclude allItems =
allItems |> Seq.filter (whereNotExistsIn itemsToExclude)
[| "one"; "two"; "three"; |]
|> except [|"two"|]
|> Dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment