The cantor
package is a comprehensive toolkit for set operations for the Go Programming Language.
Features:
-
Basic and Advanced Set Operations:
-
Infinite, Implicit Sets: In addition to HashSets, you can implicitly define sets using a Predicate. Such sets can represent infinitely many elements and be used within certain limitations together with other types of sets.
-
Dynamic Data Views: If you use set operations in
cantor
, you will define a dynamic data view on the underlying sets without doing any evaluation upfront. Such a derived set can be used for lookups, iteration or be used to construct new HashSets. -
Performance by Design: Due to the powerful yet simple lazy evaluation using boolean expressions, no intermediate results have to be allocated. This makes the usage of complex set operations highly performant and keeps pressure off the garbage collector.
-
Type Safety and Generics: Utilizes Go's generics and a system of interfaces to ensure type safety across set operations. The type system also ensures correct and sensible usage of the components of this package.
-
Stability and Confidence:
- An ever-growing test suite including more than
250
tests. 100%
code coverage enforced byCI
.- High code quality, enforced by
golangci-lint
. - Guaranteed compatibility with Go
v1.18
onwards.
- An ever-growing test suite including more than
The following diagram represents the public facing API of cantor
. The transparent parts of the diagram are not yet implemented but planned.
Here you will find a list of the release notes for all versions.
Here, you can find the development guide.