Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

sum

🌌sum

sum -- generic sum of the elements of a Sequence of numeric.

This allows summing the elements of a list, as in

l := [1,2,3]
say (sum l) # '6'

§n
 => 
T

NYI: the following code to get T's sum monoid does not work for l.isEmpty,
it should be something like

m := T.sum