about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-map.nix
blob: 6ff42d0891dca7cfad5368a4f337fe653acb3309 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[
  # 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 ]
  )

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