Names for small functions: just say no... Re: Data.List.join

Henning Thielemann lemming at
Mon Oct 30 02:37:55 EST 2006

On Fri, 27 Oct 2006, Josef Svenningsson wrote:

> My argument for intercalate builds on the fact that intersperse seems
> to be the wrong abstraction. Recall that I supplied some evidence that
> intersperse is only used together with concat:
> Except for pretty printing, intersperse always comes together with
> concat.

I can tell you at least two non-concat applications of 'intersperse'.  

1. Transforming a power series for 'f' to the onw for '\x -> f(x^2)'
is simply 'intersperse 0'.
2. Upsampling a signal as needed for wavelet transform.

However, you can argue that these applications are special cases of
inserting (n-1) zeros between list items in order to multiply the length
by a factor of n, and thus 'intersperse' doesn't scale well for this

More information about the Libraries mailing list