Array-like

An array like object is one that can be looked at and processed as a sequence of elements, like an array. In JavaScript, a common example of an array-like object is the arguments object in functions, which has a length property and can be accessed by index, but it doesn't include functions from Array.prototype such as slice or map. Anything array-like can be turned into an array by fun/array/to-array.

Composable

Function composition is an act or mechanism to combine simple functions to build more complicated ones. Like the usual composition of functions in mathematics, the result of each function is passed as the argument of the next, and the result of the last one is the result of the whole.

The ability to easily compose functions encourages factoring (breaking apart) functions for maintainability and code reuse. More generally, big systems might be built by composing whole programs.

(Source.)

Predicate function

A function that when called will return either `true` or `false` depending on some condition. The return value is dependant on the input, in case the predicate function is a pure function.

Pure function

A function may be considered a pure function if both of the following statements about the function hold:

  • The function always evaluates the same result value given the same argument value(s). The function result value cannot depend on any hidden information or state that may change while program execution proceeds or between different executions of the program, nor can it depend on any external input from I/O devices.
  • Evaluation of the result does not cause any semantically observable side effect or output, such as mutation of mutable objects or output to I/O devices.

The result value need not depend on all (or any) of the argument values. However, it must depend on nothing other than the argument values. The function may return multiple result values and these conditions must apply to all returned values for the function to be considered pure. If an argument is call by reference, any parameter mutation will alter the value of the argument outside the function, which will render the function impure.

(Source.)

Trampoline

A trampoline is a loop that iteratively invokes thunk-returning functions (continuation-passing style). A single trampoline suffices to express all control transfers of a program; a program so expressed is trampolined, or in trampolined style; converting a program to trampolined style is trampolining. Programmers can use trampolined functions to implement tail-recursive function calls in stack-oriented programming languages.

(Source.)