mapfn(fn)
Return a function that takes a sequence xs
as its argument and returns a sequence of the
results of applying fn
to each element of xs
.
let doubler = mapfn(^(x) x * 2)
doubler([1,2,3,4,5])
// [2, 4, 6, 8, 10]
let adder = mapfn(add)
adder([1, 2, 3], [4, 5, 6])
// [5, 7, 9]