id_effect 0.2.0

Effect<A, E, R> (sync + async), context/layers, pipe — interpreter-style, no bundled executor
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! Ex 064 — `scan` carries state while emitting mapped outputs.
use id_effect::{Stream, run_blocking};

fn main() {
  let s = Stream::range(1, 5).scan(0_i64, |acc, x| {
    *acc += x;
    *acc
  });
  assert_eq!(run_blocking(s.run_collect(), ()), Ok(vec![1, 3, 6, 10]));
  println!("064_stream_scan ok");
}