about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.nix
blob: 71b351fd55b06f0d544eb7cb1c6e4d971584068d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[
  # identity function
  (builtins.map (x: x) [ 1 2 3 4 5 ])

  # double stuff
  (builtins.map (x: x * 2) [ 1 2 3 4 5 ])

  # same but with a closure this time
  (
    let n = 2;
    in builtins.map (x: x * n) [ 1 2 3 4 5 ]
  )

  # same, but with a builtin
  (builtins.map (builtins.mul 2) [ 1 2 3 4 5 ])

  # from global scope
  (map (x: x) [ 1 2 3 4 5 ])
]