Dnia 24-10-2010 o 21:34:54 Philippe Sigaud <philippe.sig...@gmail.com> napisał(a):

That's what Haskell calls ZipWith. I called it tmap (as in tuple-map)
when I needed it in D.
IMHO, it should be a generalization of std.algorithm.map: let it
accept n ranges and a n-ary function. It can even do a partial check
at compile-time.

It could be. As long as the job gets done it doesn't matter what will be generalized, Map or Zip. One will cover other's functionality entirely.

Extending filter() and reduce() to work with n ranges in parallel and
a n-args function is also useful.
you may be interested in looking there:
http://www.dsource.org/projects/dranges/
(more specifically, in the algorithm module)

Nice lib. Any plans to incorporate some of it to Phobos?

--
Tomek

Reply via email to