diff options
Diffstat (limited to 'graphics/asymptote/base/mapArray.asy')
-rw-r--r-- | graphics/asymptote/base/mapArray.asy | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/graphics/asymptote/base/mapArray.asy b/graphics/asymptote/base/mapArray.asy new file mode 100644 index 0000000000..5a499b8c68 --- /dev/null +++ b/graphics/asymptote/base/mapArray.asy @@ -0,0 +1,9 @@ +typedef import(Src, Dst); + +private typedef Dst MapType(Src); + +Dst[] map(MapType f, Src[] a) { + return sequence( + new Dst(int i) {return f(a[i]);}, + a.length); +}
\ No newline at end of file |