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

Add sort primop

This commit is contained in:
Eelco Dolstra 2015-07-28 18:39:00 +02:00
parent 50807f3dd5
commit 76cc8e97a2
4 changed files with 68 additions and 1 deletions

View 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"; } ])
]