On 2/22/22 05:53, steve wrote:

> What I was trying
> to return is function that can then be applied to e.g. an array.

I think an eponymous template that defines an alias as in your original post can be used as well:

template mappified(alias func) {
  import std.algorithm : map;
  alias mappified = map!func;
}

void main() {
  import std.stdio;
  writeln([1,2].mappified!(a => a * 10));
}

There is std.functional which includes function composition tools:

  https://dlang.org/phobos/std_functional.html

Ali

Reply via email to