Documentation ¶
Index ¶
- func BFS[T comparable](initial T, neighbors func(T) ([]T, error), visit func(T) error) error
- func Coinflip(num, dem int) bool
- func DFS[T comparable](initial T, neighbors func(T) ([]T, error), visit func(T) error) error
- func Filter[T any](arr []T, f func(T) bool) []T
- func Index[T any](arr []T, f func(T) bool) int
- func Int() int
- func Intn(max int) int
- func IntnRange(min, max int) int
- func Map[T any, V any](arr []T, f func(T) V) []V
- func MapValues[K comparable, V any](m map[K]V) []V
- func Max[T Numeric](a, b T) T
- func Merge(maps ...map[string]interface{}) map[string]interface{}
- func ProbeGraph[T comparable](prober Prober[T], initial T, neighbors func(T) ([]T, error), ...) error
- func Reduce[T any, V any](arr []T, acc V, f func(T, V) V) V
- func Retry(op func() error, maxTries uint64) (err error)
- func Reverse[T any](arr []T) []T
- func String(n int) string
- func TopSort[T comparable](vals []T, neighbors func(T) ([]T, error)) ([]T, error)
- func TopsortGraph[T comparable](g containers.Graph[T]) ([]T, error)
- type FetchPageFunc
- type Numeric
- type PageInfo
- type PageIter
- type Pager
- type Prober
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BFS ¶
func BFS[T comparable](initial T, neighbors func(T) ([]T, error), visit func(T) error) error
func DFS ¶
func DFS[T comparable](initial T, neighbors func(T) ([]T, error), visit func(T) error) error
func Intn ¶ added in v0.0.4
Intn generates an integer in range [0,max). By design this should panic if input is invalid, <= 0.
func IntnRange ¶ added in v0.0.4
IntnRange generates an integer in range [min,max). By design this should panic if input is invalid, <= 0.
func MapValues ¶ added in v0.1.7
func MapValues[K comparable, V any](m map[K]V) []V
func ProbeGraph ¶
func ProbeGraph[T comparable](prober Prober[T], initial T, neighbors func(T) ([]T, error), visit func(T) error) error
func String ¶ added in v0.0.4
String generates a random alphanumeric string, without vowels, which is n characters long. This will panic if n is less than zero.
func TopSort ¶
func TopSort[T comparable](vals []T, neighbors func(T) ([]T, error)) ([]T, error)
func TopsortGraph ¶ added in v0.0.2
func TopsortGraph[T comparable](g containers.Graph[T]) ([]T, error)
Types ¶
type FetchPageFunc ¶ added in v0.1.6
Click to show internal directories.
Click to hide internal directories.