[Haskell-cafe] Help wanted: Lazy multiway zipper with mismached
mm3 at zepler.net
Mon Sep 26 15:53:53 EDT 2005
Perhaps I am being obtuse, but why would you need to pass a continuation for each list, rather than just passing the list? If the head does not encapsultate all relevant infromation about the list, could you not wrap the list with another datastructure, which you update (pass a derived version of) at each iteration?
On Mon, Sep 26, 2005 at 08:17:10PM +0200, Rene de Visser wrote:
> >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?
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe