feat(sterni/nix/int): add sum function

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
This commit is contained in:
sterni 2022-10-11 02:15:49 +02:00 committed by clbot
parent 81fadbe6eb
commit 0025a6fd64

View file

@ -100,6 +100,8 @@ let
inRange = a: b: x: x >= a && x <= b; inRange = a: b: x: x >= a && x <= b;
sum = builtins.foldl' (a: b: a + b) 0;
in in
{ {
inherit inherit
@ -122,5 +124,6 @@ in
toHex toHex
fromHex fromHex
inRange inRange
sum
; ;
} }