lib.pipe: Avoid creating scopes

This commit is contained in:
adisbladis
2023-12-11 16:25:21 +13:00
parent eec92ca9df
commit c8c2ae638a
+1 -3
View File
@@ -58,9 +58,7 @@ rec {
of the next function, and the last function returns the
final value.
*/
pipe = val: functions:
let reverseApply = x: f: f x;
in builtins.foldl' reverseApply val functions;
pipe = builtins.foldl' (x: f: f x);
# note please dont add a function like `compose = flip pipe`.
# This would confuse users, because the order of the functions