
11 Jun
2008
11 Jun
'08
3:03 p.m.
Am Mittwoch, 11. Juni 2008 20:17 schrieb Andrew Coppin:
So it looks like this can be implemented as a fold or an unfold. But neither way looks especially easy. Both of these patterns seem to be more general than necessary; I only want to take 1 element of input and produce 1 element of output, but keeping track of a running state.
scanl might be a sufficiently lightweight way to do that (or it might not, depending on what you actually want to do).