Utility-belt library for functional programming in Lua (source)
operator.add(a, b) | Returns a + b. |
operator.concat(a, b) | Returns concatenation of a and b. |
operator.div(a, b) | Returns a / b. |
operator.eq(a, b) | Checks if a equals b. |
operator.exp(a, b) | Returns a ^ b. |
operator.floordiv(a, b) | Performs floor division (//) between a and b . |
operator.ge(a, b) | Checks if a is greater or equal to b. |
operator.gt(a, b) | Checks if a is strictly greater than b. |
operator.intdiv(a, b) | Performs integer division between a and b . |
operator.land(a, b) | Returns logical a and b. |
operator.le(a, b) | Checks if a is less or equal to b. |
operator.length(a) | Returns the length of a. |
operator.lnot(a) | Returns logical not a. |
operator.lor(a, b) | Returns logical a or b. |
operator.lt(a, b) | Checks if a is strictly less than b. |
operator.mod(a, b) | Returns a % b. |
operator.mul(a, b) | Returns a * b. |
operator.neq(a, b) | Checks if a not equals b. |
operator.sub(a, b) | Returns a – b. |
operator.unm(a) | Returns -a. |
adjust(t, key, f) | Adjusts the value at a given key using a function or a value. |
all(t, f) | Checks if all values in a table are passing an iterator test. |
allEqual(t[, comp]) | Checks if all values in a collection are equal. |
at(t, ...) | Collects values at given keys and return them wrapped in an array. |
best(t, f) | Returns the best value passing a selector function. |
clear(t) | Clears a table. |
containsKeys(t, other) | Checks if all the keys of other table exists in table t . |
count(t[, val]) | Counts occurrences of a given value in a table. |
countBy(t, iter) | Groups values in a collection and counts them. |
countf(t, f) | Counts the number of values passing a predicate test. |
cycle(t[, n]) | Loops n times through a table. |
detect(t, value) | Performs a linear search for a value in a table. |
each(t, f) | Iterates on key-value pairs, calling f (v, k) at every step. |
eachi(t, f) | Iterates on integer key-value pairs, calling f(v, k) every step. |
findWhere(t, props) | Returns the first value having specified keys props . |
groupBy(t, iter) | Splits a table into subsets groups. |
include(t, value) | Performs a linear search for a value in a table. |
invoke(t, method) | Invokes a method on each value in a table. |
map(t, f) | Maps f (v, k) on value-key pairs, collects and returns the results. |
mapReduce(t, f[, state]) | Reduces a table while saving intermediate states. |
mapReduceRight(t, f[, state]) | Reduces a table while saving intermediate states. |
mapi(t, f) | Maps f (v, k) on value-key pairs, collects and returns the results. |
max(t[, transform]) | Returns the max value in a collection. |
min(t[, transform]) | Returns the min value in a collection. |
pluck(t, key) | Extracts values in a table having a given key. |
reduce(t, f[, state]) | Reduces a table, left-to-right. |
reduceBy(t, f, pred[, state[, ...]]) | Reduces values in a table passing a given predicate. |
reduceRight(t, f[, state]) | Reduces a table, right-to-left. |
reject(t, f) | Clones a table while dropping values passing an iterator test. |
same(a, b) | Checks if two tables are the same. |
sameKeys(tA, tB) | Checks if both given tables have the same keys. |
select(t, f) | Selects and returns values passing an iterator test. |
size([...]) | Counts the number of values in a collection. |
sort(t[, comp]) | Sorts a table, in-place. |
sortBy(t[, transform[, comp]]) | Sorts a table in-place using a transform. |
sortedk(t[, comp]) | Iterates on values with respect to key order. |
sortedv(t[, comp]) | Iterates on values with respect to values order. |
where(t, props) | Returns all values having specified keys props . |
addTop(array, ...) | Adds all passed-in values at the top of an array. |
aperture(array[, n]) | Iterator returning sliding partitions of an array. |
append(array, other) | Clones array and appends values from another array. |
chunk(array, f) | Chunks together consecutive values. |
compact(array) | Returns all truthy values (removes falses and nils ). |
concat(array[, sep[, i[, j]]]) | Concatenates values in a given array. |
difference(array, another) | Returns values from an array not present in all passed-in args. |
disjoint(...) | Checks if all passed in arrays are disjunct. |
dropWhile(array, f) | Collects values from a given array. |
duplicates(array) | Returns an array list of all duplicates in array. |
fill(array, value[, i[, j]]) | Replaces elements in a given array with a given value. |
find(array, value[, from]) | Looks for the first occurrence of a given value in an array. |
findIndex(array, pred) | Returns the first index at which a predicate returns true. |
findLastIndex(array, pred) | Returns the last index at which a predicate returns true. |
first(array[, n]) | Returns the first N values in an array. |
flatten(array[, shallow]) | Flattens a nested array. |
indexOf(array, value) | Returns the index of the first occurrence of value in an array. |
initial(array[, n]) | Returns all values in an array excluding the last N values. |
interleave(...) | Interleaves arrays. |
interpose(array, value) | Interposes value in-between consecutive pair of values in array. |
intersection(...) | Returns the intersection of all passed-in arrays. |
isunique(array) | Checks if a given array contains distinct values. |
last(array[, n]) | Returns the last N values in an array. |
lastIndexOf(array, value) | Returns the index of the last occurrence of value in an array. |
mean(array) | Returns the mean of an array of numbers. |
median(array) | Returns the median of an array of numbers. |
nsorted(array[, n[, comp]]) | Returns the n-top values satisfying a predicate. |
nth(array, index) | Returns the value at a given index. |
ones(n) | Returns an array of n 1’s. |
overlapping(array[, n[, pads]]) | Iterator returning overlapping partitions of an array. |
pack(...) | Converts a list of arguments to an array. |
pairwise(array) | Iterator returning sliding pairs of an array. |
partition(array[, n[, pads]]) | Iterator returning partitions of an array. |
permutation(array) | Iterator returning the permutations of an array. |
powerset(array) | Returns the powerset of array values. |
prepend(array, ...) | Adds all passed-in values at the top of an array. |
product(array) | Returns the product of array values. |
pull(array, ...) | Removes all provided values in a given array. |
push(array, ...) | Pushes all passed-in values at the end of an array. |
range([from[, to[, step]]]) | Produces a flexible list of numbers. |
removeRange(array[, start[, finish]]) | Removes values at an index within the range [start, finish] . |
rep(value, n) | Creates an array list of n values, repeated. |
rest(array[, index]) | Returns all values after index. |
reverse(array) | Returns an array where values are in reverse order. |
sample(array[, n[, seed]]) | Samples n random values from an array. |
sampleProb(array, prob[, seed]) | Return elements from a sequence with a given probability. |
selectWhile(array, f) | Collects values from a given array. |
shift(array[, n]) | Removes and returns the values at the top of a given array. |
shuffle(array[, seed]) | Returns a shuffled copy of a given array. |
slice(array[, start[, finish]]) | Slices values indexed within [start, finish] range. |
sortedIndex(array, the[, comp[, sort]]) | Returns the index at which a value should be inserted. |
sum(array) | Returns the sum of array values. |
symmetricDifference(array, array2) | Performs a symmetric difference. |
union(...) | Returns the duplicate-free union of all passed in arrays. |
unique(array) | Produces a duplicate-free version of a given array. |
unshift(array[, n]) | Removes and returns the values at the end of a given array. |
vector(value, n) | Returns an array of n times a given value. |
xpairs(valua, array) | Creates pairs from value and array. |
xpairsRight(valua, array) | Creates pairs from value and array. |
xprod(array, array2) | Returns all possible pairs built from given arrays. |
zeros(n) | Returns an array of n zeros. |
zip(...) | Merges values of each of the passed-in arrays in subsets. |
zipWith(f, ...) | Merges values using a given function. |
after(f, count) | Returns a version of f that runs on the count-th call. |
applySpec(specs) | Returns a function which applies specs on args. |
ary(f[, n]) | Returns a function which accepts up to n args. |
before(f, count) | Returns a version of f that will run no more than count times. |
bind(f, v) | Binds v to be the first argument to f . |
bind2(f, v) | Binds v to be the second argument to f . |
bindall(obj, ...) | Binds methods to object. |
bindn(f, ...) | Binds ... to be the N-first arguments to function f . |
both(...) | Returns a validation function. |
call(f[, ...]) | Calls f with the supplied arguments. |
castArray(value) | Casts value as an array if it is not one. |
complement(f) | Returns the logical complement of a given function. |
compose(...) | Composes functions. |
cond(conds) | Returns a function which iterate over a set of conditions. |
constant(value) | Creates a constant function which returns the same output on every call. |
converge(f, g, h) | Converges two functions into one. |
curry(f[, n_args]) | Curries a function. |
dispatch(...) | Returns a dispatching function. |
either(...) | Returns a validation function. |
flip(f) | Creates a function of f with arguments flipped in reverse order. |
identity(value) | Returns the passed-in value. |
iterator(f, value[, n]) | Produces an iterator which repeatedly apply a function f onto an input. |
iterlen(...) | Returns the length of an iterator. |
juxtapose(value, ...) | Calls a sequence of passed-in functions with the same argument. |
memoize(f) | Memoizes a given function by caching the computed result. |
neither(...) | Returns a validation function. |
noarg(f) | Returns a function with an arity of 0. |
noop() | The no operation function. |
nthArg(n) | Returns a function that gets the nth argument. |
once(f) | Returns a version of f that runs only once. |
over(...) | Creates a function that runs transforms on all arguments it receives. |
overArgs(f, ...) | Creates a function that invokes f with its arguments transformed. |
overEvery(...) | Creates a validation function. |
overSome(...) | Creates a validation function. |
partial(f, ...) | Partially apply a function by filling in any number of its arguments. |
partialRight(f, ...) | Similar to partial, but from the right. |
pipe(value, ...) | Pipes a value through a series of functions. |
rearg(f, indexes) | Returns a function which runs with arguments rearranged. |
skip(iter[, n]) | Consumes the first n values of a iterator then returns it. |
tabulate(...) | Iterates over an iterator and returns its values in an array. |
thread(value, ...) | Threads value through a series of functions. |
threadRight(value, ...) | Threads value through a series of functions. |
time(f[, ...]) | Returns the execution time of f (...) and its returned values. |
times(iter[, n]) | Runs iter function n times. |
unary(f) | Returns a function which accepts up to one arg. |
unfold(f, seed) | Builds a list from a seed value. |
uniqueId([template]) | Generates an unique ID for the current session. |
wrap(f, wrapper) | Wraps f inside of the wrapper function. |
chain(value) | Returns a wrapped object. |
clone(obj[, shallow]) | Clones a given object properties. |
extend(destObj, ...) | Extends an object properties. |
flattenPath(obj, ...) | Flattens object under property path onto provided object. |
functions([obj]) | Returns a sorted list of all methods names found in an object. |
has(obj, key) | Checks if a given object implements a property. |
import([context[, noConflict]]) | Imports all library functions into a context. |
invert(obj) | Swaps keys with values. |
isArray(obj) | Checks if the given argument is an array. |
isBoolean(obj) | Checks if the given argument is a boolean. |
isCallable(obj) | Checks if the given argument is callable. |
isEmpty([obj]) | Checks if the given pbject is empty. |
isEqual(objA, objB[, useMt]) | Performs a deep comparison test between two objects. |
isFinite(obj) | Checks if the given argument is a finite number. |
isFunction(obj) | Checks if the given argument is a function. |
isInteger(obj) | Checks if the given argument is an integer. |
isIterable(obj) | Checks if the given object is iterable with pairs (or ipairs ). |
isNaN(obj) | Checks if the given argument is NaN (see Not-A-Number). |
isNil(obj) | Checks if the given argument is nil. |
isNumber(obj) | Checks if the given argument is a number. |
isString(obj) | Checks if the given argument is a string. |
isTable(t) | Checks if the given arg is a table. |
keys(obj) | Returns the keys of the object properties. |
kvpairs(obj) | Converts key-value pairs to an array-list of [k, v] pairs. |
obj:value() | Extracts the value of a wrapped object. |
omit(obj, ...) | Returns an object copy without black-listed properties. |
path(obj, ...) | Returns the value at a given path in an object. |
pick(obj, ...) | Returns an object copy having white-listed properties. |
property(key) | Returns a function that will return the key property of any passed-in object. |
propertyOf(obj) | Returns a function which will return the value of an object property. |
result(obj, method) | Invokes an object method. |
spreadPath(obj, ...) | Spreads object under property path onto provided object. |
tap(obj, f) | Invokes interceptor with the object, and then returns object. |
template(obj[, template]) | Applies a template to an object, preserving non-nil properties. |
toBoolean(value) | Converts any given value to a boolean |
toObj(kvpairs) | Converts an array list of [k,v] pairs to an object. |
type(obj) | Extends Lua’s type function. |
values(obj) | Returns the values of the object properties. |
Returns a + b.
Aliased as op.add
.
Returns concatenation of a and b.
Aliased as op.concat
.
Returns a / b.
Aliased as op.div
.
Checks if a equals b.
Aliased as op.eq
.
Returns a ^ b.
Aliased as op.exp
, op.pow
.
Performs floor division (//) between a
and b
.
It rounds the quotient towards minus infinity.
Aliased as op.floordiv
.
Checks if a is greater or equal to b.
Aliased as op.ge
.
Checks if a is strictly greater than b.
Aliased as op.gt
.
Performs integer division between a
and b
.
Aliased as op.intdiv
.
Returns logical a and b.
Aliased as op.land
.
Checks if a is less or equal to b.
Aliased as op.le
.
Returns the length of a.
Aliased as op.len
.
Returns logical not a.
Aliased as op.lnot
.
Returns logical a or b.
Aliased as op.lor
.
Checks if a is strictly less than b.
Aliased as op.lt
.
Returns a % b.
Aliased as op.mod
.
Returns a * b.
Aliased as op.mul
.
Checks if a not equals b.
Aliased as op.neq
.
Returns a – b.
Aliased as op.sub
.
Returns -a.
Aliased as op.unm
, op.neg
.
Adjusts the value at a given key using a function or a value.
In case f
is a function,
it should be prototyped f(v)
. It does not mutate the given table, but rather
returns a new array. In case the given key
does not exist in t
, it throws an error.
f(v)
or a value
Checks if all values in a table are passing an iterator test.
Aliased as every
f (v, k)
true
if all values passes the predicate, false
otherwise
Checks if all values in a collection are equal.
Uses an optional comp
function which is used
to compare values and defaults to isEqual when not given.
Aliased as alleq
.
isEqual
(optional)
true
when all values in t
are equal, false
otherwise.
Collects values at given keys and return them wrapped in an array.
Parameters:
Returns the best value passing a selector function.
Acts as a special case of
reduce, using the first value in t
as an initial state. It thens folds the given table,
testing each of its values v
and selecting the value passing the call f(state,v)
every time.
f (state, value)
Clears a table.
All its values become nil.
Parameters:Checks if all the keys of other
table exists in table t
.
It does not
compares values. The test is not commutative, i.e table t
may contains keys
not existing in other
.
true
or false
Counts occurrences of a given value in a table.
Uses isEqual to compare values.
Parameters:Groups values in a collection and counts them.
Parameters:
iter (v, k)
Counts the number of values passing a predicate test.
Same as count, but uses an iterator.
Returns the count for values passing the test f (v, k)
f (v, k)
Loops n
times through a table.
In case n
is omitted, it will loop forever.
In case n
is lower or equal to 0, it returns an empty function.
Aliased as loop
.
Performs a linear search for a value in a table.
Returns the key of the value if found.
The given value can be a function prototyped as f (v, value)
which should return true when
any v in the table equals the value being searched. This function is similar to find,
which is mostly meant to work with array.
Iterates on key-value pairs, calling f (v, k)
at every step.
Aliased as forEach
.
f (v, k)
Iterates on integer key-value pairs, calling f(v, k)
every step.
Only applies to values located at integer keys. The table can be a sparse array.
Iteration will start from the lowest integer key found to the highest one.
Aliased as forEachi
.
f (v, k)
Returns the first value having specified keys props
.
Parameters:
Splits a table into subsets groups.
Parameters:
iter (v, k)
Performs a linear search for a value in a table.
It does not work for nested tables.
The given value can be a function prototyped as f (v, value)
which should return true when
any v in the table equals the value being searched.
Aliased as any
, some
, contains
true
when found, false
otherwise
Invokes a method on each value in a table.
Parameters:
f (v, k)
f (v, k)
Maps f (v, k)
on value-key pairs, collects and returns the results.
Uses pairs
to iterate over elements in t
.
Aliased as collect
.
f (v, k)
Reduces a table while saving intermediate states.
Folds the table left-to-right
using a given iterator and an initial state. The iterator takes a state and a value,
and returns a new state. The result is an array of intermediate states.
Aliased as mapr
f (state, value)
Reduces a table while saving intermediate states.
Folds the table right-to-left
using a given iterator and an initial state. The iterator takes a state and a value,
and returns a new state. The result is an array of intermediate states.
Aliased as maprr
f (state, value)
Maps f (v, k)
on value-key pairs, collects and returns the results.
Uses ipairs
to iterate over elements in t
.
f (v, k)
Returns the max value in a collection.
If a transform
function is passed, it will
be used to evaluate values by which all objects will be sorted.
transform (v, k)
, defaults to identity
(optional)
Returns the min value in a collection.
If a transform
function is passed, it will
be used to evaluate values by which all objects will be sorted.
transform (v, k)
, defaults to identity
(optional)
Extracts values in a table having a given key.
Parameters:
value[key]
Reduces a table, left-to-right.
Folds the table from the first element to the last element
to a single value, using a given iterator and an initial state.
The iterator takes a state and a value and returns a new state.
Aliased as inject
, foldl
.
f (state, value)
Reduces values in a table passing a given predicate.
Folds the table left-to-right, considering only values validating a given predicate.
Parameters:f (state, value)
pred (v, k)
to select values to be considered for reduction
pred
(optional)
Reduces a table, right-to-left.
Folds the table from the last element to the first element
to single value, using a given iterator and an initial state.
The iterator takes a state and a value, and returns a new state.
Aliased as injectr
, foldr
.
f (state, value)
Clones a table while dropping values passing an iterator test.
Aliased as discard
f (v, k)
Checks if two tables are the same.
It compares if both tables features the same values, but not necessarily at the same keys.
Parameters:true
or false
Checks if both given tables have the same keys.
It does not compares values.
Parameters:true
or false
Selects and returns values passing an iterator test.
Aliased as filter
.
f (v, k)
Counts the number of values in a collection.
If being passed more than one argument it will return the count of all passed-in arguments.
Parameters:Sorts a table, in-place.
If a comparison function is given, it will be used to sort values.
Parameters:comp (a, b)
, defaults to < operator.
(optional)
Sorts a table in-place using a transform.
Values are ranked in a custom order of the results of
running transform (v)
on all values. transform
may also be a string name property sort by.
comp
is a comparison function.
transform
function to sort elements prototyped as transform (v)
. Defaults to identity
(optional)
<
operator
(optional)
Iterates on values with respect to key order.
Keys are sorted using comp
function
which defaults to math.min
. It returns upon each call a key, value
pair.
<
operator
(optional)
Iterates on values with respect to values order.
Values are sorted using comp
function
which defaults to math.min
. It returns upon each call a key, value
pair.
<
operator
(optional)
Returns all values having specified keys props
.
Parameters:
Adds all passed-in values at the top of an array.
The last elements will bubble to the top of the given array.
Parameters:Iterator returning sliding partitions of an array.
Aliased as sliding
Clones array and appends values from another array.
Parameters:
Chunks together consecutive values.
Values are chunked on the basis of the return
value of a provided predicate f (v, k)
. Consecutive elements which return
the same value are chunked together. Leaves the first argument untouched if it is not an array.
f (v, k)
. Defaults to identity.
Returns all truthy values (removes falses
and nils
).
Parameters:
Concatenates values in a given array.
Handles booleans as well. If sep
string is
passed, it will be used as a separator. Passing i
and j
will result in concatenating
only values within [i, j]
range.
Aliased as join
''
.
(optional)
Returns values from an array not present in all passed-in args.
Aliased as without
and diff
Checks if all passed in arrays are disjunct.
Parameters:
true
if the intersection of all arrays is not empty, false
otherwise.
Collects values from a given array.
The passed-in array should not be sparse.
This function collects values as long as they do not satisfy a given predicate and returns on the first truthy test.
Aliased as rejectWhile
f (v, k)
Returns an array list of all duplicates in array.
Parameters:
Replaces elements in a given array with a given value.
In case i
and j
are given
it will only replaces values at indexes between [i,j]
. In case j
is greater than the array
size, it will append new values, increasing the array size.
Looks for the first occurrence of a given value in an array.
Returns the value index if found. Uses isEqual to compare values.
Parameters:nil
otherwise.
Returns the first index at which a predicate returns true.
Parameters:
pred (v, k)
Returns the last index at which a predicate returns true.
Parameters:
pred (k, v)
Returns the first N values in an array.
Aliased as head
, take
Flattens a nested array.
Passing shallow
will only flatten at the first level.
false
.
(optional)
Returns the index of the first occurrence of value in an array.
Parameters:
Returns all values in an array excluding the last N values.
Parameters:
Interleaves arrays.
It returns a single array made of values from all passed in arrays in their given order, interleaved.
Parameters:Interposes value in-between consecutive pair of values in array.
Aliased as intersperse
Returns the intersection of all passed-in arrays.
Each value in the result is present in each of the passed-in arrays.
Parameters:Checks if a given array contains distinct values.
Such an array is made of distinct elements,
which only occur once in this array.
Aliased as isuniq
true
if the given array is unique, false
otherwise.
Returns the last N values in an array.
Parameters:
Returns the index of the last occurrence of value in an array.
Parameters:
Returns the mean of an array of numbers.
Aliased as average
Returns the median of an array of numbers.
Parameters:
Returns the n-top values satisfying a predicate.
It takes a comparison function
comp
used to sort array values, and then picks the top n-values. It leaves the original array untouched.
<
operator.
(optional)
Returns the value at a given index.
Parameters:
Returns an array of n
1’s.
Parameters:
Iterator returning overlapping partitions of an array.
If the last subsequence has lower elements than n
and pad
is
supplied, it will be adjusted to n
elements with pad
value.
n
elements
(optional)
Converts a list of arguments to an array.
Parameters:
Iterator returning sliding pairs of an array.
Parameters:
Iterator returning partitions of an array.
It returns arrays of length n
made of values from the given array. If the last partition has lower elements than n
and
pad
is supplied, it will be adjusted to n
of elements with pad
value.
n
elements
(optional)
Iterator returning the permutations of an array.
It returns arrays made of all values from the passed-in array, with values permuted.
Parameters:Returns the powerset of array values.
For instance, when given the set {1,2,3},
returns {{},{1},{2},{3},{1,2},{2,3},{1,3},{1,2,3}}
.
Adds all passed-in values at the top of an array.
As opposed to addTop, it preserves the order of the passed-in elements.
Parameters:Returns the product of array values.
Parameters:
Removes all provided values in a given array.
Aliased as remove
Pushes all passed-in values at the end of an array.
Parameters:
Produces a flexible list of numbers.
If one value is passed, will count from 1 to that value, with a default step of 1 (or -1). If two values are passed, will count from the first one to the second one, using a default step of 1 (or -1). A third value passed will be considered a step value.
Parameters:Removes values at an index within the range [start, finish]
.
Aliased as rmRange
, chop
Creates an array list of n
values, repeated.
Parameters:
n
values
Returns all values after index.
Aliased as tail
Returns an array where values are in reverse order.
The passed-in array should not be sparse.
Parameters:Samples n
random values from an array.
If n
is not specified, returns a single element.
It uses internally shuffle to shuffle the array before sampling values. If seed
is passed,
it will be used for shuffling.
Return elements from a sequence with a given probability.
It considers each value independently. Providing a seed will result in deterministic sampling. Given the same seed it will return the same sample every time.
Parameters:Collects values from a given array.
The passed-in array should not be sparse.
This function collects values as long as they satisfy a given predicate and returns on the first falsy test.
Aliased as takeWhile
f (v, k)
Removes and returns the values at the top of a given array.
Aliased as pop
Returns a shuffled copy of a given array.
If a seed is provided, it will
be used to init the built-in pseudo random number generator (using math.randomseed
).
Slices values indexed within [start, finish]
range.
Aliased as M.sub
Returns the index at which a value should be inserted.
This index is evaluated so that it maintains the sort. If a comparison function is passed, it will be used to sort values.
Parameters:f (a, b)
, defaults to < operator.
(optional)
Returns the sum of array values.
Parameters:
Performs a symmetric difference.
Returns values from array
not present in array2
and also values
from array2
not present in array
.
Aliased as symdiff
Returns the duplicate-free union of all passed in arrays.
Parameters:
Produces a duplicate-free version of a given array.
Aliased as uniq
Removes and returns the values at the end of a given array.
Parameters:
Returns an array of n
times a given value.
Parameters:
Creates pairs from value and array.
Value is always prepended to the pair.
Parameters:Creates pairs from value and array.
Value is always appended as the last item to the pair.
Parameters:Returns all possible pairs built from given arrays.
Parameters:
Returns an array of n
zeros.
Parameters:
Merges values of each of the passed-in arrays in subsets.
Only values indexed with the same key in the given arrays are merged in the same subset.
Aliased as transpose
Merges values using a given function.
Only values indexed with the same key in the given arrays are merged in the same subset.
Function f
is used to combine values.
Aliased as transposeWith
Returns a version of f
that runs on the count-th
call.
Useful when dealing with asynchronous tasks.
Parameters:f
will start running.
Returns a function which applies specs
on args.
This function produces an object having
the same structure than specs
by mapping each property to the result of calling its
associated function with the supplied arguments