Skip to content

formula::map should allow additional arguments

It would be nice if instead of just f.map(fun) we could write f.map(fun, args...); so that map calls fun(args); instead of fun();.

In particular, that would solve the problem of when fun need to capture some variable and has trouble calling itself recursively. Then we can write f.map(fun, fun) so that fun receives a pointer to itself as first arguments, or we car write f.map(fun, var1, var2) if fun is written to take the variables as argument instead of capturing them.