Comparisons\isLessThan()

predicate returns Closure returns bool pure
number → (number → bool)
At a glance — value < threshold as a reusable predicate.

Creates a predicate Closure that is true when the passed number is strictly less than the bound number.

/**
  * @param int|float $a
  * @return Closure(int|float):bool
  */
Comparisons\isLessThan($a): Closure

Returned Closure

When Comparisons\isLessThan() is called, it returns the following Closure which can be used like a regular function.

/**
  * @param int|float $b
  * @return bool
  */
$function ($b): bool

Examples

Partial Application

This can be used to create a simple closure which can be used as a regular function.

$under100 = Comparisons\isLessThan(100);

var_dump($under100(99));  // true
var_dump($under100(100)); // false (strict)

$small = array_filter([50, 100, 150], $under100);
print_r($small); // [50]

Details

Comparisons Functions

Releated Ordering Functions