Documentation
¶
Index ¶
- func GetHashFunc[T any]() func(T) H128
- func TypeKeyOf[T any]() uintptr
- func UseLHS[T any](a, _ T) T
- func UseRHS[T any](_, b T) T
- type Builder
- type CombineArgs
- type EqArgs
- type EqHash
- type H128
- type Iterator
- type Less
- type NodeArgs
- type Tree
- func (t Tree[T]) Combine(args *CombineArgs[T], u Tree[T]) (out Tree[T])
- func (t Tree[T]) Count() int
- func (t Tree[T]) Difference(args *EqArgs[T], u Tree[T]) (out Tree[T])
- func (t Tree[T]) Equal(args *EqArgs[T], u Tree[T]) bool
- func (t Tree[T]) Format(f fmt.State, verb rune)
- func (t Tree[T]) Gauge() depth.Gauge
- func (t Tree[T]) Get(v T) *T
- func (t Tree[T]) H0() H128
- func (t Tree[T]) Intersection(args *EqArgs[T], u Tree[T]) (out Tree[T])
- func (t Tree[T]) Iterator() Iterator[T]
- func (t Tree[T]) OrderedIterator(less Less[T], n int) Iterator[T]
- func (t Tree[T]) Reduce(args NodeArgs, r func(values ...T) T) (_ T, _ bool)
- func (t Tree[T]) String() string
- func (t Tree[T]) SubsetOf(args *EqArgs[T], u Tree[T]) bool
- func (t Tree[T]) Vet()
- func (t Tree[T]) Where(args *WhereArgs[T]) (out Tree[T])
- func (t Tree[T]) With(v T) (out Tree[T])
- func (t Tree[T]) Without(v T) (out Tree[T])
- type WhereArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetHashFunc ¶ added in v1.10.0
GetHashFunc returns a cached hash function for type T.
func TypeKeyOf ¶ added in v1.10.0
TypeKeyOf returns a uintptr that uniquely identifies the type T, suitable for use as a sync.Map key. It extracts the type-descriptor word from an eface wrapping *T, which is a compile-time constant. Using uintptr instead of reflect.Type avoids the expensive nilinterhash→typehash chain that sync.Map incurs when hashing interface keys.
Types ¶
type Builder ¶
type Builder[T any] struct { // contains filtered or unexported fields }
Builder[T] provides a more efficient way to build nodes incrementally.
func NewBuilder ¶
type CombineArgs ¶
func DefaultNPCombineArgs ¶
func DefaultNPCombineArgs[T any]() *CombineArgs[T]
DefaultNPCombineArgs provides default combiner with non-parallel behaviour.
func DefaultNPKeyCombineArgs ¶
func DefaultNPKeyCombineArgs[T any]() *CombineArgs[T]
func NewCombineArgs ¶
func NewCombineArgs[T any](ea *EqArgs[T], combine func(a, b T) T) *CombineArgs[T]
func (*CombineArgs[T]) Flip ¶
func (a *CombineArgs[T]) Flip() *CombineArgs[T]
type EqArgs ¶
func DefaultNPEqArgs ¶
DefaultNPEqArgs provides default equality with non-parallel behaviour.
func DefaultNPKeyEqArgs ¶
func NewDefaultEqArgs ¶
NewDefaultEqArgs creates EqArgs using the default resolved hash and equality functions.
type NodeArgs ¶
func NewNodeArgs ¶
type Tree ¶
type Tree[T any] struct { // contains filtered or unexported fields }