[Haskell-cafe] Help wanted: Lazy multiway zipper with mismached intervals

Rene de Visser rene_de_visser at hotmail.com
Mon Sep 26 14:17:10 EDT 2005

>From: ChrisK <chrisk at MIT.EDU>
>Rene de Visser wrote:
>Does a single list have only disjoint intervals?
Yes. The lists are strictly increasing
>Doing this for two lists with a recursive function is easy. There being
>an output element whenever the intervals of the two input lists overlap.
Yes, I have done this.

> > However the combination of merging multiple lists together, and ignoring
> > a list in the case it is not needed by the computation leads to very
> > messy code.
> >
>Do mean multiple as in "at least three"?

>  If so, then what do have an
>output element only if all three or more input elements overlap, or do
>you have an output element when at least two input elements overlap?

That can depend on the values (payloads) per entry. For example I might have 
a selector operator and one of the lists steers from which of the other 
lists I should take the value for that interval.

I think a continuation per list would provide a nice solution.
But I don't know how to do that, and it might be horribly ineffecient?


More information about the Haskell-Cafe mailing list