Function composition: Difference between revisions

No edit summary
Line 737:
<lang objeck>
bundle Default {
class FunctionalTest {
@f : static : (Int) ~ Int;
@g : static : (Int) ~ Int;
function : Main(args : String[]) ~ Nil {
Composecompose := Composer(F(Int) ~ Int, G(Int) ~ Int, 13)->PrintLine();
compose(13)->PrintLine();
}
Line 750 ⟶ 754:
}
function : Compose(f : (Int) ~ Int, g : (Int) ~ Int, x : Int) ~ Int {
return @f(@g(x));
}
function : Composer(f : (Int) ~ Int, g : (Int) ~ Int) ~ (Int) ~ Int {
@f := f;
@g := g;
return Compose(Int) ~ Int;
}
}
}
</lang>
returnsprints: 42
 
=={{header|OCaml}}==
760

edits