Skip to content

Instantly share code, notes, and snippets.

@hcarty
Created January 20, 2014 17: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 hcarty/8524021 to your computer and use it in GitHub Desktop.
Save hcarty/8524021 to your computer and use it in GitHub Desktop.
BatSet infix operator possibilities
(* In the context of BatSet and BatSet.Make *)
module Infix = struct
let ( <-- ) s x = add x s
let ( < ) a b = not (equal a b) && subset a b
let ( > ) b a = not (equal a b) && subset a b
let ( <= ) a b = subset a b
let ( >= ) b a = subset a b
let ( - ) a b = diff a b
let ( ^ ) a b = union a b
let ( & ) a b = inter a b
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment