Merge pull request #273467 from adisbladis/lib-pipe-no-let

lib.pipe: Avoid creating a scope
This commit is contained in:
Silvan Mosberger 2023-12-11 17:16:05 +01:00 committed by GitHub
commit 581adae822
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -70,9 +70,7 @@ in {
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