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

sum0

sum0

§sum0(U 
type
:numerics sum0.T, T 
type
:numeric sum0.T, n U, l Sequence sum0.T)
 => 
T
:
Any 

sum0 -- generic sum of the elements of a Sequence of numeric with type parameter.

This allows summing the elements of a list, as in

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

NYI: When we move numerics.sum to numeric.type.sum, we should not need this any longer.