core

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: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cardinal

type Cardinal uint

Cardinal represents a cardinal number.

const CardinalAleph0 Cardinal = CardinalLarge + 1

CardinalAleph0 represents the cardinality of the natural numbers, the smallest infinite cardinal, commonly denoted by ℵ₀.

const CardinalLarge Cardinal = math.MaxInt + 1

CardinalLarge represents a finite cardinal that is too large to be represented by a non-negative int.

func CardinalFromInt

func CardinalFromInt(i int) (Cardinal, error)

CardinalFromInt turns a non-negative int into a Cardinal. It returns an error if the int is negative.

func QuickCardinalityOf

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

QuickCardinalityOf returns the cardinality of the set if it can be determined without counting its elements.

func (Cardinal) AsInt

func (c Cardinal) AsInt() (int, bool)

AsInt returns the cardinal as an int (and true) when it is representable as a non-negative integer. Otherwise, it returns 0 and false.

func (Cardinal) IsFinite

func (c Cardinal) IsFinite() bool

IsFinite returns true when the cardinal is finite (i.e. a natural number). It does NOT mean that it is representable as an int or

type CountableSetOf

type CountableSetOf[Obj any] interface {
	SetOf[Obj]
	seqs.Seq[Obj]
}

CountableSetOf represents a countable set of objects. When enumerating a countable set it can yield its objects in any order but must not yield the same object twice.

type Modifiable

type Modifiable[Obj any] interface {
	// Exclude modifies the collection so that none of the specified objects are present in it.
	Exclude(...Obj)
	// Include modifies the collection so that all of the specified objects are present in it.
	Include(...Obj)
}

Modifiable defines how a set can be modified.

type SetOf

type SetOf[Obj any] interface {
	Contains(obj Obj) bool
}

SetOf represents a set of objects.

Jump to

Keyboard shortcuts

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