<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 10.5.2015 2:28, Ivan Levkivskyi wrote:<br>
<blockquote
cite="mid:16174_1431214114_554E9821_16174_32_1_CAOMjWkmVXoMr07tOUKL7iEavN8b3sVer7nPPMrRH55RTtN60dw@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div dir="ltr">
<div>functions. In other words I agree with Andrew that
"elementwise" is a good match with compose, and what we really
need is to "pipe" things that take a vector (or just an
iterable) and return a vector (iterable).<br>
</div>
<div>
<div>
<div>
<div>
<div><br>
So that probably a good place (in a potential future)
for compose would be not functools but itertools. But
indeed a good place to test this would be Numpy.<br>
</div>
<br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
Another way to deal with elementwise operations on iterables would
be to make a small, mostly backwards compatible change in map:<br>
<br>
When map is called with just one argument, for instance map(square),
it would return a function that takes iterables and maps them
element-wise. <br>
<br>
Now it would be easier to use map in pipelines, for example:<br>
<br>
rms = sqrt @ mean @ map(square)<br>
<br>
or <br>
<br>
values->map(square)->mean->sqrt()<br>
<br>
Or if the change in map is not popular, there could be something
like functools.mapper(func) that does that. Or even something more
crazy, like square.map(seq), so that square.map could be used in
pipelines.<br>
<br>
-- Koos<br>
<br>
</body>
</html>