laziness of intersperse

Thomas Schilling nominolo at googlemail.com
Sat Aug 16 19:42:53 EDT 2008


On Sat, Aug 16, 2008 at 7:22 PM, Bart Massey <bart at cs.pdx.edu> wrote:
> A cleaner but still fully lazy version of intersperse might be
>
>    intersperse sep (x1 : x2 : xs) =
>        x1 : sep : intersperse sep (x2 : xs)
>    intersperse _ l = l

Doesn't that fail on (x:_|_) ?  Also it relies on constructor
specialisation to be efficient.

> (I'd quote to give some context, but gmane says I can't unless I artificially
> pad the length of my new text.  Is there any way to post to this list other than
> gmane?)

Subscribe?  http://www.haskell.org/mailman/listinfo/libraries


More information about the Libraries mailing list