Documentation
¶
Overview ¶
Package api defines interfaces implemented by library structs and common types.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var U = Unit{}
U is the unit instance, representing the single instance of the type nothing.
Functions ¶
This section is empty.
Types ¶
type BasicSet ¶ added in v0.0.5
type BasicSet[C comparable] interface { // String returns the string representation of the set. // Example: // { (), (), () } String() string // Len counts the elements in the set. Len() int // Elements returns the unique elements of the set. Elements() []C // Add unique elements to the set. // Repeated elements will be discarded. Add(elements ...C) // Contains checked whether all elements are in the set. Contains(elements ...C) bool // Remove any existing elements from the set. Remove(elements ...C) }
BasicSet is an interface for a basic implementation of a set of comparables.
type FloatingPoint ¶ added in v0.0.5
type Integer ¶ added in v0.0.5
type Integer interface { SignedInteger | UnsignedInteger }
type Interval ¶ added in v0.0.5
type Interval[T Number] interface { Min() T Max() T Len() T IsEmpty() bool IsSingleton() bool IsCompound() bool Enumerate(step T) []T Intervals() []Interval[T] Contains(value T) bool Overlaps(other Interval[T]) bool Equals(other Interval[T]) bool Union(other Interval[T]) Interval[T] Intersection(other Interval[T]) Interval[T] Difference(other Interval[T]) Interval[T] Resize(newSize T, growMode GrowFlags) Interval[T] Scale(scale float64, growMode GrowFlags) Interval[T] Translate(offset T, back bool) Interval[T] }
type Number ¶ added in v0.0.5
type Number interface { Integer | FloatingPoint }
type SignedInteger ¶ added in v0.0.5
Click to show internal directories.
Click to hide internal directories.