This adds the Unify method to our map function and also switches the arg order because I decided it would look nicer. Completely untested.
14 lines
216 B
Plaintext
14 lines
216 B
Plaintext
import "iter"
|
|
|
|
$fn = func($x) { # type changes from str to int
|
|
len($x)
|
|
}
|
|
|
|
$in = ["a", "bb", "ccc", "dddd", "eeeee",]
|
|
|
|
$out = iter.xmap($in, $fn) # XXX: change to map
|
|
|
|
$t = template("out: {{ . }}", $out)
|
|
|
|
test $t {}
|