Documentation ¶
Index ¶
- func Accumulate[T any](items []T, accumulator func(T, T) T) T
- func AccumulateE[T any](items []T, accumulator func(T, T) (T, error)) (T, error)
- func Any[T any](f func(T) bool, list []T)
- func C[T any](fns ...func(some T) T) func(some T) T
- func C2[T any, S any, R any](fn1 func(some S) R, fn2 func(some T) S) func(some T) R
- func C3[T any, S any, R any, U any](fn0 func(some R) U, fn1 func(some S) R, fn2 func(some T) S) func(some T) U
- func C4[T any, S any, R any, U any, V any](fn01 func(some U) V, fn0 func(some R) U, fn1 func(some S) R, ...) func(some T) V
- func C5[T any, S any, R any, U any, V any, W any](fn02 func(some V) W, fn01 func(some U) V, fn0 func(some R) U, ...) func(some T) W
- func Compose[T any, S any, R any](fn1 func(some S) R, fn2 func(some T) S) func(some T) R
- func Concat[T any](left []T, right []T) []T
- func Cons[X any](x X, list []X) []X
- func Contains[T comparable](s []T, e T) bool
- func ContainsDuplicatesErr[T comparable](list []T) error
- func DefaultPtr[T any](value *T, defaultValue T) T
- func DefaultPtrOrValue[T any](value *T, defaultValue T) T
- func DefaultValue[T any](value T, defaultValue T) T
- func Deref[T any](x *T) T
- func DictMerge[K comparable, V any](left map[K]V, right map[K]V) map[K]V
- func Difference[T comparable](from []T, remove []T) []T
- func Duplicate[T any](x T) []T
- func Enconcat[X any](before []X, x X, after []X) []X
- func Fanout[T any, R any](fs []func(T) R, item T) []R
- func Filter[T any](fn func(some T) bool, list []T) []T
- func FilterEmpty[T comparable](l []T) []T
- func Find[T any](list []*T, f func(*T) bool) *T
- func First[X any](list []X) *X
- func Flatmap[T any, R any](fn func(some T) []R, list []T) []R
- func FlatmapE[T any, R any](fn func(some T) ([]R, error), list []T) ([]R, error)
- func Flatten[T any](listOfLists [][]T) []T
- func Flip[X any, Y any, Z any](fn func(X, Y) Z) func(Y, X) Z
- func Fmap[T any, R any](fn func(some T) R, list []T) []R
- func Foldl[T any, R any](fn func(acc R, next T) R, base R, list []T) R
- func FoldlE[T any, R any](fn func(acc R, next T) (R, error), base R, list []T) (R, error)
- func Foldr[T any, R any](fn func(next T, carry R) R, base R, list []T) R
- func FromJSON[T any](j []byte) (T, error)
- func GetAValueFromMap[K comparable, V any](m map[K]V) *V
- func GetMapKeys[K comparable, V any](m map[K]V) []K
- func GetMapValues[K comparable, V any](m map[K]V) []V
- func Id[T any](x T) T
- func InitialNotEqual[T any](i T) func(l T) bool
- func IsEmpty[T any](x T) bool
- func IsEmptyValP[T any](x *T) bool
- func Keys[T comparable, R any](dict map[T]R) []T
- func ListContains[K comparable](list []K, item K) bool
- func ListHas[K any](list []K, item K, has func(l, r K) bool) bool
- func ListItemsAreErr[T comparable](items []T, are []T) error
- func ListOfPointersToListOfValues[T any](list []*T) []T
- func ListOfSomethingToListOfAny[T any](l []T) []any
- func ManyIntegersToInts[T constraints.Integer](i []T) []int
- func ManyStringLikeToStrings[T ~string](i []T) []string
- func Map[T, R any](items []T, mapper func(T) R) []R
- func MapContainsKey[K comparable, V any](m map[K]V, key K) bool
- func MapE[T, R any](items []T, mapper func(T) (R, error)) ([]R, error)
- func MapFromList[T any, R comparable](list []T, keySelector func(l T) R) map[R]T
- func MapToStruct[T any](m any) (T, error)
- func MergeMaps[K comparable, V any](maps ...map[K]V) map[K]V
- func P2[X any, Y any, Z any](fn func(X, Y) Z, x X) func(Y) Z
- func Ptr[T any](x T) *T
- func RemoveDuplicates[T comparable](list []T) []T
- func ReturnOnCondition[T any](ctx context.Context, fetcher func(ctx context.Context) (T, error), ...) (T, error)
- func S[T any](fns ...func(some T) T) func(some T) T
- func SortBy[X any](sortFn func(X, X) bool, list []X) []X
- func ToDict[T comparable](xs []T) map[T]bool
- func TryCopyTo[T any, R any](t T, r R, options copier.Option) (R, error)
- func TryCopyToNew[T any, R any](t T, options copier.Option) (R, error)
- func Uniq[T comparable](xs []T) []T
- func ValueOrZero[T any](ptr *T) T
- func ZeroValueToNil[T any](x T) *T
- type Params
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Accumulate ¶ added in v0.6.124
func Accumulate[T any](items []T, accumulator func(T, T) T) T
func AccumulateE ¶ added in v0.6.124
func Contains ¶ added in v0.6.74
func Contains[T comparable](s []T, e T) bool
func ContainsDuplicatesErr ¶ added in v0.6.124
func ContainsDuplicatesErr[T comparable](list []T) error
func DefaultPtr ¶ added in v0.6.124
func DefaultPtr[T any](value *T, defaultValue T) T
func DefaultPtrOrValue ¶ added in v0.6.124
func DefaultPtrOrValue[T any](value *T, defaultValue T) T
return default if ptr is nil or de-referenced ptr value is empty
func DefaultValue ¶ added in v0.6.124
func DefaultValue[T any](value T, defaultValue T) T
func DictMerge ¶
func DictMerge[K comparable, V any](left map[K]V, right map[K]V) map[K]V
func Difference ¶
func Difference[T comparable](from []T, remove []T) []T
func FilterEmpty ¶ added in v0.6.74
func FilterEmpty[T comparable](l []T) []T
func FlatmapE ¶ added in v0.6.124
Take a list of things and a function that returns a list of things then combines list after mapping (return early from error) func T -> [R, R, R ...] [T, T, T ...] -> [R, R, R ...]
func GetAValueFromMap ¶ added in v0.6.124
func GetAValueFromMap[K comparable, V any](m map[K]V) *V
func GetMapKeys ¶ added in v0.6.124
func GetMapKeys[K comparable, V any](m map[K]V) []K
func GetMapValues ¶ added in v0.6.124
func GetMapValues[K comparable, V any](m map[K]V) []V
func InitialNotEqual ¶ added in v0.6.124
func IsEmptyValP ¶ added in v0.6.124
func Keys ¶ added in v0.6.53
func Keys[T comparable, R any](dict map[T]R) []T
func ListContains ¶ added in v0.6.124
func ListContains[K comparable](list []K, item K) bool
func ListItemsAreErr ¶ added in v0.6.124
func ListItemsAreErr[T comparable](items []T, are []T) error
takes a list of items and checks if items are elements in another list
func ListOfPointersToListOfValues ¶ added in v0.6.124
func ListOfPointersToListOfValues[T any](list []*T) []T
func ListOfSomethingToListOfAny ¶ added in v0.6.124
func ManyIntegersToInts ¶ added in v0.6.124
func ManyIntegersToInts[T constraints.Integer](i []T) []int
func ManyStringLikeToStrings ¶ added in v0.6.124
func Map ¶ added in v0.6.124
func Map[T, R any](items []T, mapper func(T) R) []R
func T -> R [T, T, T ...] -> [R, R, R ...]
func MapContainsKey ¶ added in v0.6.111
func MapContainsKey[K comparable, V any](m map[K]V, key K) bool
func MapFromList ¶ added in v0.6.124
func MapFromList[T any, R comparable](list []T, keySelector func(l T) R) map[R]T
func MapToStruct ¶ added in v0.6.124
pass in m a map of string to any
func MergeMaps ¶ added in v0.6.124
func MergeMaps[K comparable, V any](maps ...map[K]V) map[K]V
right maps override left if they have the same key
func RemoveDuplicates ¶ added in v0.6.124
func RemoveDuplicates[T comparable](list []T) []T
func ReturnOnCondition ¶ added in v0.6.124
func ToDict ¶
func ToDict[T comparable](xs []T) map[T]bool
func TryCopyToNew ¶ added in v0.6.124
func Uniq ¶
func Uniq[T comparable](xs []T) []T
func ValueOrZero ¶ added in v0.6.124
func ValueOrZero[T any](ptr *T) T
func ZeroValueToNil ¶ added in v0.6.124
func ZeroValueToNil[T any](x T) *T
return value or nil if value is zero
Types ¶
Click to show internal directories.
Click to hide internal directories.