From 4d545297d85c8f32f7ab496d0759f40d881bd61d Mon Sep 17 00:00:00 2001 From: zimbatm Date: Tue, 4 Jul 2017 23:29:23 +0100 Subject: lib: introduce imap0, imap1 (#25543) * lib: introduce imap0, imap1 For historical reasons, imap starts counting at 1 and it's not consistent with the rest of the lib. So for now we split imap into imap0 that starts counting at zero and imap1 that starts counting at 1. And imap is marked as deprecated. See https://github.com/NixOS/nixpkgs/commit/c71e2d42359f9900ea2c290d141c0d606471da16#commitcomment-21873221 * replace uses of lib.imap * lib: move imap to deprecated.nix --- lib/strings.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/strings.nix') diff --git a/lib/strings.nix b/lib/strings.nix index 1cc633c729dcc..a03694d1b1d72 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -33,7 +33,7 @@ rec { concatImapStrings (pos: x: "${toString pos}-${x}") ["foo" "bar"] => "1-foo2-bar" */ - concatImapStrings = f: list: concatStrings (lib.imap f list); + concatImapStrings = f: list: concatStrings (lib.imap1 f list); /* Place an element between each element of a list @@ -70,7 +70,7 @@ rec { concatImapStringsSep "-" (pos: x: toString (x / pos)) [ 6 6 6 ] => "6-3-2" */ - concatImapStringsSep = sep: f: list: concatStringsSep sep (lib.imap f list); + concatImapStringsSep = sep: f: list: concatStringsSep sep (lib.imap1 f list); /* Construct a Unix-style search path consisting of each `subDir" directory of the given list of packages. -- cgit 1.4.1