Imperative set-like data structure.
Primary differences from a simple set:
It is an error to modify a bag (
remove_one, ...) during iteration
remove_one t removes some element from the bag, and returns its value.
remove_one runs in constant time.
filter_inplace t ~f removes all the elements from
t that don't satisfy
until_empty t f repeatedly removes a value
t and runs
t is empty. Running
f may add elements to
t if it
unchecked_iter t ~f behaves like
iter t ~f except that
f is allowed to modify
t. Elements added by
f may or may not be visited, elements removed by
have not been visited will not be visited. It is an (undetected) error to delete the