[Haskell-cafe] Simple list processing

Daniel Fischer daniel.is.fischer at web.de
Wed Jun 11 15:03:11 EDT 2008

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).

More information about the Haskell-Cafe mailing list