package
0.6.0
Repository: https://github.com/go-board/std.git
Documentation: pkg.go.dev

# Functions

All returns true if all elements in the given slice satisfy the given predicate.
Any returns true if any element in the given slice satisfies the given predicate.
Backward create a [iter.Seq] in backward order.
Chunk returns a new slice with the given slice split into smaller slices of the given size.
Clone returns a new slice with the same elements as the given slice.
Collect all elements in [Seq] and return a slice.
No description provided by the author
No description provided by the author
Contains returns true if the given slice contains the given element.
ContainsBy returns true if the given slice contains an element that satisfies the given predicate.
DeepClone returns a new slice with the cloned elements.
DeepCloneBy returns a new slice with the cloned elements as the given slice.
Difference returns a new slice with the elements that are in the first slice but not in the second.
DifferenceBy returns a new slice with the elements that are in the first slice but not in the second by the given function.
Distinct returns a new slice with the given slice without duplicates.
DistinctBy returns a new slice with the distinct elements of the given slice by the given function.
No description provided by the author
No description provided by the author
Filter returns a new slice with all elements that satisfy the given predicate.
FilterIndexed returns a new slice with all elements that satisfy the given predicate.
First finds first element.
No description provided by the author
FirstNonZero returns first non-zero value zero value are: integer and float: 0 bool: false string: empty string, aka: "" pointer: nil pointer struct with all field is zero value interface: nil chan/map/slice: nil.
FlatMap returns a new slice with all elements in the given slice and all elements in the given slices.
Flatten returns a new slice with all elements in the given slice and all elements in all sub-slices.
FlattenBy returns a new slice with all elements in the given slice and all elements in the given slices.
Fold accumulates value starting with initial value and applying accumulator from left to right to current accum value and each element.
FoldRight accumulates value starting with initial value and applying accumulator from right to left to current accum value and each element.
ForEach iterates over the given slice and calls the given function for each element.
ForEachIndexed iterates over the given slice and calls the given function for each element.
Forward create a [iter.Seq] in forward order.
GroupBy returns a new map with the given slice split into smaller slices of the given size.
No description provided by the author
IndexBy returns the index of the first element in the given slice that satisfies the given predicate.
Intersection returns a new slice with the elements that are in both give slices.
IntersectionBy returns a new slice with the elements that are in both given slices by the given function.
No description provided by the author
No description provided by the author
Last finds last element.
No description provided by the author
LastIndex returns the index of the last element in the given slice that same with the given element.
LastIndexBy returns the index of the last element in the given slice that satisfies the given predicate.
Map returns a new slice with the results of applying the given function to each element in the given slice.
MapIndexed returns a new slice with the results of applying the given function to each element in the given slice.
Max returns the maximum element in the given slice.
MaxBy returns the maximum element in the given slice that satisfies the given function.
No description provided by the author
Min returns the minimum element in the given slice.
MinBy returns the minimum element in the given slice that satisfies the given function.
No description provided by the author
None returns true if no element in the given slice satisfies the given predicate.
Nth returns the nth element in the given slice.
Partition split slice into two slices according to a predicate.
Reduce returns the result of applying the given function to each element in the given slice.
ReduceRight returns the result of applying the given function to each element in the given slice.
Reverse returns a new slice with the elements in the given slice in reverse order.
Shuffle the given slice in-place.
Single returns the single element, or return an error if the collection is empty or has more than one element.
No description provided by the author
No description provided by the author
SpliceFirst return first element and rest if len > 0, else return (None, []T) Example: slices.SpliceFirst([]int{1,2,3}) => Some(1), []int{2,3} slices.SpliceFirst([]int{}) => None, []int{}.
SpliceLast return last element and rest if len > 0, else return (None, []T) Example: slices.SpliceLast([]int{1,2,3}) => Some(1), []int{1,2} slices.SpliceLast([]int{}) => None, []int{}.
ToHashMap converts the given slice to a map by the given key function.
ToHashSet returns a new set with the given slice.
ToIndexedMap converts the given slice to a map from index to element.
TryFold accumulates value starting with initial value and applying accumulator from left to right to current accum value and each element.
No description provided by the author
TryMap returns a new slice and an error.
No description provided by the author