Discover Packages
github.com/filecoin-project/mir
pkg
util
sliceutil
package
Version:
v0.2.2
Opens a new window with list of versions in this module.
Published: Feb 23, 2023
License: Apache-2.0
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Any returns an arbitrary element of the slice.
If the slice is not empty, the second return value is true.
Otherwise, Any returns the zero value of the slice's element type and false.
func Filter[T any ](ts []T, f func(i int , t T) bool ) []T
func Generate[T any ](n int , f func(i int ) T) []T
func Repeat[T any ](value T, n int ) []T
Repeat returns a slice with value repeated n times.
func Transform[T, R any ](ts []T, f func(i int , t T) R) []R
Source Files
¶
Click to show internal directories.
Click to hide internal directories.