Prelude.filter

This commit is contained in:
2021-08-12 18:49:36 -06:00
parent a1eb3f2b97
commit 9e947a626a
2 changed files with 7 additions and 1 deletions

View File

@@ -517,4 +517,10 @@ class Prelude {
throw "Can't run a subprocess on this target.";
#end
}
public static function filter<T>(l:Iterable<T>, ?p:(T) -> Bool):kiss.List<T> {
if (p == null)
p = Prelude.truthy;
return Lambda.filter(l, p);
}
}