Structure family
Sets
After the bird count, Alice, Bob, and Carol survey the wildlife cameras along their trails. Each hiker lists the cameras they find and shares the list later. Adding is easy. Removal is hard: if Alice erases a camera from her notebook, the next note from a hiker who still lists it puts the camera back. The three sets below answer that in three steps: never remove, remove forever, or give each addition its own identity so an item can return.
g_set_kernel
A GSet can add items but cannot remove them. When people share their lists, the set keeps every item that appears on any list.
Best for
- Recorded event IDs, observed devices, and permanent labels
- Membership that must only grow
- Updates
- Add only
- How copies combine
- Keep every listed item
- What it remembers
- Every item ever added
two_p_set_kernel
A TwoPSet keeps one list of added items and another list of removed items. Once an item appears on the removed list, nobody can add the same item again.
Best for
- Revoked credentials and decommissioned equipment
- Membership where removal must win permanently
- Updates
- Add, then remove permanently
- How copies combine
- Keep every addition and removal
- What it remembers
- Items and permanent removals
or_set_kernel
This set gives each addition its own identity. A removal affects only the additions that person has already seen. An addition made at the same time, or later, can stay in the set.
Best for
- Collaborative selections, tags, rosters, and carts
- Membership that must support remove and re-add
- Updates
- Add, remove, and re-add
- How copies combine
- Keep additions that were not removed
- What it remembers
- Each addition and known removals
Choose what removal means
| Need | Choose | Cost |
|---|---|---|
| Items never leave | GSet | Every item ever added |
| Removal is permanent | TwoPSet | Items and permanent removals |
| Items can return | Observed-remove set | Each addition and known removals |