1Array.map(3kaya) Kaya module reference Array.map(3kaya)
2
3
4
6 Array::map - Map a function across an array.
7
9 [b] map( b(a) f, [a] xs )
10
12 f The function to apply
13
14 xs The array
15
17 Returns the array created by applying function f to every element of xs
18
19
20
21 xs = ["abc","d","efghij"];
22 ys = map(length,xs);
23 // ys = [3,1,6]
24
25 or
26
27
28 xs = [1,-5,2,-7,-4];
29 ys = map(abs,xs);
30 // ys = [1,5,2,7,4]
31
33 Kaya standard library by Edwin Brady, Chris Morris and others
34 (kaya@kayalang.org). For further information see http://kayalang.org/
35
37 The Kaya standard library is free software; you can redistribute it
38 and/or modify it under the terms of the GNU Lesser General Public
39 License (version 2.1 or any later version) as published by the Free
40 Software Foundation.
41
43 Array.zipWith (3kaya)
44 Array.fold (3kaya)
45
46
47
48Kaya December 2010 Array.map(3kaya)