sets

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 6, 2025 License: MIT-0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CardinalFromInt = core.CardinalFromInt

Functions

func AreEqual

func AreEqual[SetA, SetB CountableSetOf[Obj], Obj any](setA SetA, setB SetB) bool

AreEqual returns true if the specified sets contain the same objects.

func ContainsAllOf added in v0.5.0

func ContainsAllOf[Obj any](set SetOf[Obj], objs ...Obj) bool

ContainsAllOf returns true if set contains all of the specified objects.

func ContainsAllOfIter added in v0.6.0

func ContainsAllOfIter[Obj any](set SetOf[Obj], seq iter.Seq[Obj]) bool

ContainsAllOfIter return true if set contains all of the objects in seq.

func ContainsAnyOf

func ContainsAnyOf[Obj any](set SetOf[Obj], objs ...Obj) bool

ContainsAnyOf returns true if set contains any of the specified objects.

func ContainsAnyOfIter added in v0.6.0

func ContainsAnyOfIter[Obj any](set SetOf[Obj], seq iter.Seq[Obj]) bool

ContainsAnyOfIter returns true if set contains any of the objects in seq.

func IsEmpty added in v0.7.0

func IsEmpty[Obj any](set SetOf[Obj]) (empty bool, known bool)

IsEmpty returns (true, true) when the set is empty, (false, true) when the set is not empty, and (false, false) when it is unknown.

Types

type Cardinal added in v0.6.0

type Cardinal = core.Cardinal

func CardinalityOf

func CardinalityOf[Obj any](set SetOf[Obj]) (Cardinal, bool)

CardinalityOf returns the cardinality of the set if it can be determined.

Calling it on an infinite set might result in an infinite loop.

func QuickCardinalityOf

func QuickCardinalityOf[Obj any](set SetOf[Obj]) (Cardinal, bool)

type CountableSetOf

type CountableSetOf[Obj any] = core.CountableSetOf[Obj]

func CountableIntersectionOf

func CountableIntersectionOf[SetA, SetB CountableSetOf[Obj], Obj any](setA SetA, setB SetB) CountableSetOf[Obj]

CountableIntersectionOf returns the intersection of the two specified countable sets.

func CountableRelativeComplementOf

func CountableRelativeComplementOf[SetA, SetB CountableSetOf[Obj], Obj any](setA SetA, setB SetB) CountableSetOf[Obj]

CountableRelativeComplementOf returns the countable relative complement of set A in set B.

func CountableUnionOf

func CountableUnionOf[SetA, SetB CountableSetOf[Item], Item any](setA SetA, setB SetB) CountableSetOf[Item]

CountableUnionOf returns the union of the two specified countable sets.

type Modifiable added in v0.2.0

type Modifiable[Obj any] = core.Modifiable[Obj]

type SetOf

type SetOf[Obj any] = core.SetOf[Obj]

func ComplementOf

func ComplementOf[Set SetOf[Obj], Obj any](set Set) SetOf[Obj]

ComplementOf returns the complement of the specified set.

func IntersectionOf

func IntersectionOf[SetA, SetB SetOf[Obj], Obj any](setA SetA, setB SetB) SetOf[Obj]

IntersectionOf returns the intersection of the two specified sets.

func RelativeComplementOf

func RelativeComplementOf[SetA, SetB SetOf[Obj], Obj any](setA SetA, setB SetB) SetOf[Obj]

RelativeComplementOf returns the relative complement of set A in set B.

This is also known as the set difference of B and A, denoted B \ A or B - A.

func UnionOf

func UnionOf[SetA, SetB SetOf[Item], Item any](setA SetA, setB SetB) SetOf[Item]

UnionOf returns the union of the two specified sets.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL