Golang package containing functools using Go generics
functools
is a set of functions for functional programming in Golang.
It contains the following methods:
arrayEquals
: checks if two arrays are equalcopyWithin
: copy a value from target to destination within the arrayevery
: check if every element satisfies the given conditionfill
: fill the given range with the given valuefilter
: pick the values that satisfy the given conditionfind
: find the first value that satisfies the conditionfindIndex
: find the index of the first value that satisfies the conditionforEach
: run a given function for all the values in the arrayincludes
: check if the given value is present in the arrayjoin
: join the array as a string using a delimitermap
: run a given method for all the elements and return the resultreduce
: reduce the array into a single value using a given conditionreverse
: reverse the arrayshift
: remove the first element from the arraysome
: check if some element(s) of the array satisfies the conditionsort
: sort the arrayunshift
: add values in front of the array