PHP: Chained Method Calls

Chaining method calls of Higher Order Functions.

As you’ve probably noticed the way in which PHP calls it’s Higher-Order Functions is quite different from C#, Java and Swift. Basically PHP by default uses method calls that wrap the input as opposed to the C#, Java and Swift which rely on method chaining.
Tags: Functional, PHP, Higher-Order

FOLD: Higher Order Function

Recursive combination of elements using a function.

In functional programming, fold (also termed reduce, accumulate, aggregate, compress, or inject) refers to a family of higher-order functions that recursively combine elements of a data structure using a function.
Tags: Functional, Fold, Reduce, Aggregate, Accumulate, C#, C++, Java, Javascript, Perl, PHP, Python, Ruby, Rust, Swift