mirror of
https://github.com/NixOS/nix
synced 2025-07-08 06:53:54 +02:00
Add sort primop
This commit is contained in:
parent
50807f3dd5
commit
76cc8e97a2
4 changed files with 68 additions and 1 deletions
8
tests/lang/eval-okay-sort.nix
Normal file
8
tests/lang/eval-okay-sort.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
with builtins;
|
||||
|
||||
[ (sort lessThan [ 483 249 526 147 42 77 ])
|
||||
(sort (x: y: y < x) [ 483 249 526 147 42 77 ])
|
||||
(sort lessThan [ "foo" "bar" "xyzzy" "fnord" ])
|
||||
(sort (x: y: x.key < y.key)
|
||||
[ { key = 1; value = "foo"; } { key = 2; value = "bar"; } { key = 1; value = "fnord"; } ])
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue