Wraps OrderedMap with unit values for a pure set interface. Keys are ordered by a user-supplied comparator function: cmp(a, b) < 0 means a < b cmp(a, b) = 0 means a = b cmp(a, b) > 0 means a > b
Types
typeTreeTree(a) = Leaf | Node(Tree(a), a, Tree(a), Int)#
Functions
fnnewnew(cmp : (a, a) -> Int) : %{cmp: (a, a) -> Int, tree: Tree(a)}#
Creates a new empty sorted set with the given comparator.
fnaddadd(s : %{cmp: (a, a) -> Int, tree: Tree(a)}, v : a) : %{cmp: (a, a) -> Int, tree: Tree(a)}#
Adds element v to the set. No-op if already present.
fnremoveremove(s : %{cmp: (a, a) -> Int, tree: Tree(a)}, v : a) : %{cmp: (a, a) -> Int, tree: Tree(a)}#
Removes element v from the set. No-op if not present.
fnmembermember(s : %{cmp: (a, a) -> Int, tree: Tree(a)}, v : a) : Bool#