λ Functional
Functional programming treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data. It is declarative, which means expressions instead of statements.
identity()
identity()use Siler\Functional as λ;
array_map(λ\identity(), [1, 2, 3]);
// [1, 2, 3]always($value)
always($value)use Siler\Functional as λ;
array_map(λ\always('foo'), range(1, 3));
// [foo, foo, foo]if_else(callable $cond) -> $then -> $else
if_else(callable $cond) -> $then -> $elsepartial(callable $callable, ...$partial)
partial(callable $callable, ...$partial)match(array $matches)
match(array $matches)Last updated