From c8c2ae638aa2e723a2b3517c4390d3c46d671ee8 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Mon, 11 Dec 2023 16:21:46 +1300 Subject: [PATCH] lib.pipe: Avoid creating scopes --- lib/trivial.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/trivial.nix b/lib/trivial.nix index caff77190fde..9b7e4563444f 100644 --- a/lib/trivial.nix +++ b/lib/trivial.nix @@ -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 don’t add a function like `compose = flip pipe`. # This would confuse users, because the order of the functions