compose

Compose two Functions.

compose
(
F
G
)
(
F f
,
G g
)
if (
is(F : Function!(F.InputType, F.OutputType)) &&
is(G : Function!(G.InputType, G.OutputType))
&&
is(F.OutputType : G.InputType)
)

Examples

auto f = RealFunction!(triple!int).get.compose(RealFunction!(increment!int).get);
auto g = RealFunction!(increment!int).get.compose(RealFunction!(triple!int).get);
assert (f(0) == 1);
assert (f(1) == 4);
assert (g(0) == 3);
assert (g(1) == 6);

Meta