1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 06:01:48 +02:00

lib.concatMap and lib.mapAttrs to be builtins

This commit is contained in:
volth 2018-07-05 02:52:02 +00:00
parent 3defdccf4b
commit 403a76a18f
5 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1 @@
[ [ 1 3 5 7 9 ] [ "a" "z" "b" "z" ] ]

View file

@ -0,0 +1,5 @@
with import ./lib.nix;
[ (builtins.concatMap (x: if x / 2 * 2 == x then [] else [ x ]) (range 0 10))
(builtins.concatMap (x: [x] ++ ["z"]) ["a" "b"])
]

View file

@ -0,0 +1 @@
{ x = "x-foo"; y = "y-bar"; }

View file

@ -0,0 +1,3 @@
with import ./lib.nix;
builtins.mapAttrs (name: value: name + "-" + value) { x = "foo"; y = "bar"; }