Documentation ¶
Index ¶
- func Atoi(s string) int
- func CSort[V constraints.Ordered](av []V) []V
- func ChompNL(line string) string
- func DuplicateSlice[V any](av []V) []V
- func Grep[T any](predicate func(T) bool, in []T) []T
- func IsEmptyArray[T any](t []T) bool
- func IsEmptyString(s string) bool
- func Keys[K comparable, V any](m map[K]V) []K
- func MapSlice[T, U any](fn func(T) U, ts []T) []U
- func Max[V Numeric](av []V) V
- func Min[T constraints.Ordered](ts []T) T
- func Must[T any](t T, err error) T
- func NReverse[T any](a []T)
- func New2DArray[T any](n, m int) [][]T
- func New2DArrayWithDefault[T any](n, m int, def T) [][]T
- func Not[T any](predicate func(T) bool) func(T) bool
- func Product[V Numeric](av []V) V
- func ReadBlankLineSeparatedBlocks(reader io.Reader) ([][]string, error)
- func ReadJustOneLine(reader io.Reader) (string, error)
- func ReadLines(reader io.Reader) ([]string, error)
- func Reverse[T any](a []T) []T
- func Shuffle[T any](t []T)
- func Sort[V constraints.Ordered](av []V)
- func Sum[V Numeric](av []V) V
- func Values[K comparable, V any](m map[K]V) []V
- type Numeric
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CSort ¶
func CSort[V constraints.Ordered](av []V) []V
CSort sorts a copy of the data and returns the updated copy. (This should probably be renamed Sort?)
func DuplicateSlice ¶
func DuplicateSlice[V any](av []V) []V
func IsEmptyArray ¶
func IsEmptyString ¶
func Keys ¶
func Keys[K comparable, V any](m map[K]V) []K
func MapSlice ¶
func MapSlice[T, U any](fn func(T) U, ts []T) []U
MapSlice is the moral equivalent of Lisp's mapcar. It is not used in the presence of polite company by Go programmers, who just write a for loop.
func New2DArray ¶
func New2DArrayWithDefault ¶
func Sort ¶
func Sort[V constraints.Ordered](av []V)
Sort sorts the data in place. (This should be renamed QSort?)
func Values ¶
func Values[K comparable, V any](m map[K]V) []V
Types ¶
Click to show internal directories.
Click to hide internal directories.