Documentation ¶
Index ¶
- func AllSlice[C any](a []C, pred func(C) bool) bool
- func AnySlice[C any](a []C, pred func(C) bool) bool
- func FilterSlice[C any](in []C, pred func(C) bool) []C
- func FoldSlice[C any](s []C, reduction func(C, C) C) C
- func MapSlice[C any](a []C, procedure func(C) C) []C
- func PartitionSlice[C any](col []C, pred func(C) bool) ([]C, []C)
- func QuickSortSlice[C constraints.Ordered](in []C) []C
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllSlice ¶
AllSlice returns a boolean representing whether the predicate returns true for all members of the collection.
func FilterSlice ¶
FilterSlice creates a new slice of all elements for which the predicate returns false.
func FoldSlice ¶
func FoldSlice[C any](s []C, reduction func(C, C) C) C
FoldSlice returns the result of applying the rediction function to each member of collection sequentially.
func MapSlice ¶
func MapSlice[C any](a []C, procedure func(C) C) []C
MapSlice returns a collection the same size as the input collection, where each output is the result of applying procedure to the input element.
func PartitionSlice ¶
PartitionSlice returns two arrays, the first containing elements which satify the predicate, the second containing elements which do not.
func QuickSortSlice ¶
func QuickSortSlice[C constraints.Ordered](in []C) []C
Implements the Quicksort algorythm on a collection of Ordered elements
Types ¶
This section is empty.