mirror of
https://github.com/NixOS/nix
synced 2025-07-08 02:43:54 +02:00
Make lists be comparable
Makes lists comparable using lexicographic comparison. Increments builtins.langVersion in order for this change to be detectable
This commit is contained in:
parent
720ed47678
commit
09471d2680
5 changed files with 41 additions and 11 deletions
|
@ -4,5 +4,17 @@ with builtins;
|
|||
(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"; } ])
|
||||
[ { key = 1; value = "foo"; } { key = 2; value = "bar"; } { key = 1; value = "fnord"; } ])
|
||||
(sort lessThan [
|
||||
[ 1 6 ]
|
||||
[ ]
|
||||
[ 2 3 ]
|
||||
[ 3 ]
|
||||
[ 1 5 ]
|
||||
[ 2 ]
|
||||
[ 1 ]
|
||||
[ ]
|
||||
[ 1 4 ]
|
||||
[ 3 ]
|
||||
])
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue