ok I got the idea with fold. The only difference between fold and scan is that scan won't emit the first value, which is I think ok this can be achieved with other combinators easily.