progress with versioning
This commit is contained in:
parent
618cdf7314
commit
e106ced1ec
8 changed files with 151 additions and 238 deletions
|
|
@ -19,6 +19,12 @@ export const add = set => key => set.tree.get(key) === true ? set : new RBTreeWr
|
|||
export const remove = set => key => new RBTreeWrapper(set.tree.remove(key), inspectSet);
|
||||
export const length = set => set.tree.length;
|
||||
|
||||
export const union = setA => setB =>
|
||||
fold
|
||||
(acc => cur => add(acc)(cur))
|
||||
(setA)
|
||||
(setB);
|
||||
|
||||
export const fold = callback => initial => set => {
|
||||
let acc = initial;
|
||||
for (const iter=set.tree.begin; iter !== undefined && iter.valid; iter.next()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue