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

* Generalised the dependencyClosure primop to builtins.genericClosure,

which is hopefully more useful.
* New primops: length, mul, div.
This commit is contained in:
Eelco Dolstra 2008-07-11 13:29:04 +00:00
parent d567baabbd
commit 7cd88b1dec
5 changed files with 442 additions and 139 deletions

View file

@ -0,0 +1,13 @@
let
closure = builtins.genericClosure {
startSet = [{key = 80;}];
operator = {key, foo ? false}:
if builtins.lessThan key 0
then []
else [{key = builtins.sub key 9;} {key = builtins.sub key 13; foo = true;}];
};
sort = (import ./lib.nix).sortBy (a: b: builtins.lessThan a.key b.key);
in sort closure