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:
parent
3defdccf4b
commit
403a76a18f
5 changed files with 52 additions and 0 deletions
1
tests/lang/eval-okay-concatmap.exp
Normal file
1
tests/lang/eval-okay-concatmap.exp
Normal file
|
@ -0,0 +1 @@
|
|||
[ [ 1 3 5 7 9 ] [ "a" "z" "b" "z" ] ]
|
5
tests/lang/eval-okay-concatmap.nix
Normal file
5
tests/lang/eval-okay-concatmap.nix
Normal 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"])
|
||||
]
|
1
tests/lang/eval-okay-mapattrs.exp
Normal file
1
tests/lang/eval-okay-mapattrs.exp
Normal file
|
@ -0,0 +1 @@
|
|||
{ x = "x-foo"; y = "y-bar"; }
|
3
tests/lang/eval-okay-mapattrs.nix
Normal file
3
tests/lang/eval-okay-mapattrs.nix
Normal file
|
@ -0,0 +1,3 @@
|
|||
with import ./lib.nix;
|
||||
|
||||
builtins.mapAttrs (name: value: name + "-" + value) { x = "foo"; y = "bar"; }
|
Loading…
Add table
Add a link
Reference in a new issue