Returns true iff trs is currently empty. O(1).
Returns the current number of elements in trs. O(1).
Returns an arbitrary element of the current contents of trs. Specifically, on a nonempty set, returns two values: an arbitrary element and true; on an empty set, returns two false values. O(1).
If trs is nonempty, returns its first element (the first one added to it) and a true second
value; otherwise, nil and false. O(1).
If trs is nonempty, returns its last element (the one most recently added to it) and a true
second value; otherwise, nil and false. O(1).
Returns the index of x within the ordering of rs, or nil if it is not found.
NOTE: O(n).
Returns the element at index idx within the ordering of rs. Signals an error if idx is out of bounds. O(log n).
Returns true iff x is currently an element of trs. O(log n).
Removes all elements from trs, resetting it to the empty state. O(1).
Modifies trs so that it contains value. Has no effect if this was already the case. Returns trs. O(log n).
Modifies trs so that it does not contain value. Has no effect if this was already the case. Returns trs. O(log n).
Returns a persistent FSet ch-replay-set (the usual kind, with functional semantics) with the
contents of trs. Subsequent modifications to the transient are permitted, and of course will
not affect the persistent one.
This operation has two modes, depending on copy?. If copy? is false (the default), it takes O(1) time; but subsequent modifications to the transient will behave performance-wise as if a new transient had been created. If copy? is true, the operation takes O(n) time, but subsequent modifications to the transient will run at full speed. Copying the collection also compacts it, so it uses less heap space.