Documentation ¶
Overview ¶
The set package provides a generic set interface and some implementations of it.
Is this going too far?!
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Set ¶
type Set[ self any, elem Equaler[elem], ] interface { // New returns a new empty instance of the set. New() self // Union sets the contents of the receiver to // the union of a and b and returns the receiver. Union(a, b self) self // Intersect sets the contents of the receiver to // the union of a and b and returns the receiver. Intersect(a, b self) self // Iter returns an iterator that visits each member // of the set in turn. Iter() Iter[elem] // Add adds the given elements to the set. Add(elem) // Add removes the given elements to the set. Remove(elem) }
Set defines a mutable set; members can be added and removed and the set can be combined with itself.
Click to show internal directories.
Click to hide internal directories.