mirror of
https://github.com/NixOS/nix
synced 2025-07-08 11:03:54 +02:00
* Builtin function `add' to add integers.
* Put common test functions in tests/lang/lib.nix.
This commit is contained in:
parent
d315210612
commit
2ab4bc44c7
11 changed files with 68 additions and 26 deletions
|
@ -1,13 +1,7 @@
|
|||
with import ./lib.nix;
|
||||
|
||||
let {
|
||||
|
||||
fold = op: nul: list:
|
||||
if list == []
|
||||
then nul
|
||||
else op (builtins.head list) (fold op nul (builtins.tail list));
|
||||
|
||||
concat =
|
||||
fold (x: y: x + y) "";
|
||||
|
||||
body = concat ["foo" "bar" "bla" "test"];
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue