good fusion (was Re: inits)

Josef Svenningsson josef.svenningsson at
Tue Apr 11 08:37:48 EDT 2006

On 4/11/06, Bulat Ziganshin <bulat.ziganshin at> wrote:
> Hello Josef,
> Monday, April 10, 2006, 9:22:31 PM, you wrote:
> >> > Wasn't there some consensus that foldr/build
> >> > cannot deforest both lists that go into zip?
Umm... I didn't write that. Udo Stenzel did.

> that is a typical problem of "two simultaneous control structures" and
> one it's solution is using coroutines. lazily evaluated lists is of
> course another solution, but it is not so fast
> may be, some lightweight form of coroutines can be used in such
> situations to perfrom job faster?
I not sure how to understand your comment in the context of the
present discussion. As I said before, it is indeed possible to fuse
zipWith[1..] with other funcions. The only problem is that we don't
know how to do it for all list argument at the same time *within the
foldr/build framework*. And since ghc only uses foldr/build at the
moment we have to fuse the zipWith family of functions by hand if we
want to achieve fusion.



More information about the Libraries mailing list