dhall-nix-lib/Number/sum.dhall

13 lines
293 B
Text

λ(nix : ../NixPrelude.dhall) →
let Number = ./Type.dhall
let Number/add = ./add.dhall nix
let fromNatural = ./fromNatural.dhall nix
let sum
: List Number → Number
= λ(xs : List Number) →
List/fold Number xs Number Number/add (fromNatural 0)
in sum