Documentation
¶
Index ¶
- func DedupSorted[T comparable, S ~[]T](xs S) S
- func DedupSortedFunc[T any, S ~[]T](xs S, eq func(a, b T) bool) S
- func Filter[T any, S ~[]T](xs S, fn func(T) bool) S
- func FoldLeft[X, Acc any, S ~[]X](xs S, init Acc, fn func(Acc, X) Acc) Acc
- func FoldRight[X, Acc any, S ~[]X](xs S, init Acc, fn func(Acc, X) Acc) Acc
- func Map[A, B any, SA ~[]A](as SA, fn func(A) B) []B
- func Merge[T cmp.Ordered, S ~[]T](dst S, left, right S) int
- func MergeFunc[T any, S ~[]T](dst S, left, right S, cmp func(a, b T) int) (n int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DedupSorted ¶
func DedupSorted[T comparable, S ~[]T](xs S) S
DedupSorted removes duplicate items according to eq It doesn't actually matter how the items are sorted as long as items which could be the same are adjacent.
func DedupSortedFunc ¶
DedupSortedFunc removes duplicate items according to eq It doesn't actually matter how the items are sorted as long as items which could be the same are adjacent. Note that the last arg `eq` is a function that returns true for equality, not for less-than.
func FoldLeft ¶
func FoldLeft[X, Acc any, S ~[]X](xs S, init Acc, fn func(Acc, X) Acc) Acc
FoldLeft implements foldl, as described here https://en.wikipedia.org/wiki/Fold_(higher-order_function)
func FoldRight ¶
func FoldRight[X, Acc any, S ~[]X](xs S, init Acc, fn func(Acc, X) Acc) Acc
FoldRight implements foldr, as described here https://en.wikipedia.org/wiki/Fold_(higher-order_function)
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.