Erik Meijer wrote:
> Zipping lists however is *much* easier expressed using anamorphisms
> or unfold. The reason is that when zipping two lists you are
> co-inductively *constructing* a list, and not so much inductively
> destructing a list. Hence the trick of inductively destructing a
> list that returns a function that inductively destructs the second
> list and build the resulting list of pairs.
Zipping lists is equally easy if your are inductively destructing the
*product* of two lists. One ends up with Fegaras style catas[1].
> Have fun!
Cheers,
Laszlo (who already had enough of this kind of fun)
[1] L.Fegaras: Improving Programs which Recurse over Multiple
Inductive Structures
(PEPM 1994 or his home page)
- Re: Zipping two sequences together with only cons, empt... Kevin Atkinson
- Re: Zipping two sequences together with only cons, empt... Lennart Augustsson
- Re: Zipping two sequences together with only cons, empt... Kevin Atkinson
- Re: Zipping two sequences together with only cons, empt... Lennart Augustsson
- Re: Zipping two sequences together with only cons, empt... Kevin Atkinson
- Re: Zipping two sequences together with only cons, empt... Koen Claessen
- Re: Zipping two sequences together with only cons, empt... Torsten Grust
- Re: Zipping two sequences together with only cons, empt... Peter Hancock
- Re: Zipping two sequences together with only cons, empt... Laszlo Nemeth
- Re: Zipping two sequences together with only cons, empt... Erik Meijer
- Re: Zipping two sequences together with only cons, empt... Laszlo Nemeth
- Re: Zipping two sequences together with only cons, empt... Lennart Augustsson
- Re: Zipping two sequences together with only cons, empt... Lennart Augustsson
