static class TestedFunction : Function!(int, string) { override string opCall(int x) { import std.math, std.conv; return sqrt(real(1) + x * x).to!string; } mixin Singleton; } auto t = TestedFunction.get; auto t0 = t.functionTupleIdentity, t1 = t.tupleTupleIdentity!(int[]), t2 = t.eitherFunctionIdentity, t3 = t.eitherEitherIdentity!(int[]); static assert (is (typeof (t0) : Function!(int, Tuple!(string, int)))); static assert (is (typeof (t1) : Function!(Tuple!(int, int[]), Tuple!(string, int[])))); static assert (is (typeof (t2) : Function!(Either!(int, string), string))); static assert (is (typeof (t3) : Function!(Either!(int, int[]), Either!(string, int[]))));
(a -> b) -> (a|c -> b|c)