[][src]Function lukkid::zigma

pub fn zigma<I, S>(l: I, s: S) -> S where
    I: Iterator<Item = S>,
    S: AddAssign

Sum all list in Sequence or Anukrom Struct

Examples

let sl = zigma(Sequence::new(2,10,2), 0);
assert_eq!(sl, 20);

Alternative

We can use outsite method of this library as you need.

let fl = Sequence::new(2, 10, 2).fold(0,|acc,x|acc+x);
assert_eq!(fl, 20);