Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Function-composition/D/function-composition.d
Normal file
11
Task/Function-composition/D/function-composition.d
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import std.stdio;
|
||||
|
||||
T delegate(S) compose(T, U, S)(in T delegate(U) f,
|
||||
in U delegate(S) g) {
|
||||
return s => f(g(s));
|
||||
}
|
||||
|
||||
void main() {
|
||||
writeln(compose((int x) => x + 15, (int x) => x ^^ 2)(10));
|
||||
writeln(compose((int x) => x ^^ 2, (int x) => x + 15)(10));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue