.\" This man page is automatically generated using .\" kayadoc2man from the Kaya development tools and the -xmldocs compile .\" option. Editing it directly is not encouraged. .\" It is under the same license as the source .k file that it was .\" generated from. .TH "Array.zipWith" "3kaya" "August 2014" "Kaya" "Kaya module reference" .SH "NAME" Array::zipWith \- Map a function across two arrays. .SH "SYNOPSIS" .B [c] zipWith( \fIc(a, b) f, [a] xs, [b] ys\fP .B ")" .SH "ARGUMENTS" .PP .B "f" The function to use .PP .B "xs" The first array .PP .B "ys" The second array .SH "DESCRIPTION" .PP Returns the array created by applying function \fIf\fP to every pairwise elements of \fIxs\fP and \fIys\fP If the arrays are of different lengths, then the resulting array will be the same size as the shorter of the two input arrays. .PP The function must take \fBxs[0] \fP and \fBys[0] \fP to give \fBzs[0] \fP and so on. .IP "" -4 Int sum(Int a, Int b) { return a+b; } Void main() { xs = [1,2,3,4,5]; ys = [7,8,9]; zs = zipWith(sum,xs,ys); // zs = [8,10,12]; } .SH "AUTHORS" Kaya standard library by Edwin Brady, Chris Morris and others (kaya@kayalang.org). For further information see http://kayalang.org/ .SH LICENSE The Kaya standard library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (version 2.1 or any later version) as published by the Free Software Foundation. .SH "RELATED" .PD 0 .PP .B "Array.map"(3kaya) .PP .B "Array.zip"(3kaya) .PD 0.4v