introduce lt predicate (<)
authorwidmogrod <widmogrod@gmail.com>
Sun, 11 Feb 2018 00:45:12 +0000 (01:45 +0100)
committerwidmogrod <widmogrod@gmail.com>
Sun, 18 Feb 2018 17:47:11 +0000 (18:47 +0100)
src/Functional/predicates.php

index bb6b41b..f1373e1 100644 (file)
@@ -21,6 +21,24 @@ function eql($expected, $value = null)
     })(...func_get_args());
 }
 
+const lt = 'Widmogrod\Functional\lt';
+
+/**
+ * lt :: a -> a -> Bool
+ *
+ * @param mixed $expected
+ * @param mixed $value
+ *
+ * @return mixed
+ */
+function lt($expected, $value = null)
+{
+    return curryN(2, function ($expected, $value) {
+        return $value < $expected;
+    })(...func_get_args());
+}
+
+
 const orr = 'Widmogrod\Functional\orr';
 
 /**