about summary refs log tree commit diff
path: root/users/sterni/nix/int/default.nix
diff options
context:
space:
mode:
authorsterni <sternenseemann@systemli.org>2022-10-11T00·15+0200
committerclbot <clbot@tvl.fyi>2022-10-11T18·35+0000
commit0025a6fd64465e1c1fd42ec4e86535cf184e0ad4 (patch)
tree7f427f54aec95eace8e2a49c924165ab50454e85 /users/sterni/nix/int/default.nix
parent81fadbe6eb037cbbe08e35ea692fd1dbe993f354 (diff)
feat(sterni/nix/int): add sum function r/5107
Change-Id: I7c3109b27ba91c848fd8b64d979d5e3c5c4583aa
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6944
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'users/sterni/nix/int/default.nix')
-rw-r--r--users/sterni/nix/int/default.nix3
1 files changed, 3 insertions, 0 deletions
diff --git a/users/sterni/nix/int/default.nix b/users/sterni/nix/int/default.nix
index 54b55964722d..a39a9477e211 100644
--- a/users/sterni/nix/int/default.nix
+++ b/users/sterni/nix/int/default.nix
@@ -100,6 +100,8 @@ let
 
   inRange = a: b: x: x >= a && x <= b;
 
+  sum = builtins.foldl' (a: b: a + b) 0;
+
 in
 {
   inherit
@@ -122,5 +124,6 @@ in
     toHex
     fromHex
     inRange
+    sum
     ;
 }