On Fri, Jul 27, 2012 at 12:40 AM, Patrick O'Leary
<
patrick...@gmail.com> wrote:
> On Thursday, July 26, 2012 11:08:39 PM UTC-5, Jeff Bezanson wrote:
>>
>> In most functional languages I've used, map of an n-argument function
>> accepts n containers to iterate over, for example map(+, A, B) for
>> elementwise add of two arrays.
> In Haskell, map works over a single container, and zipWith works over two
> (and zipWith3 over three, etc.). The implementation of zip is the
> application of the tuple constructor to zipWith.
Well, that's because in Haskell all functions have only a single
argument: it is currying, not tupling. That's a more or less
arbitrary choice, with upsides and downsides. Julia, however, is
tupling, and should probably use Lisp-style map.
> Using "map" to apply higher arity functions in lieu of zipWith is probably
> fine, though. It just approaches from a different--in our case, probably
> more appropriate--point of view.
+1
--
GMail doesn't have rotating .sigs, but you can see mine at
http://www.ccil.org/~cowan/signatures