ceylon.language.compose.ceylon Maven / Gradle / Ivy
"Given a function with return type `Y`, and a second
function with a single parameter also of type `Y`, return
the composition of the two functions. The first function
may have any number of parameters.
For any such functions `f()` and `g()`,
compose(g,f)(*args)==g(f(*args))
for every possible argument tuple `args` of `f()`."
see(`function curry`, `function uncurry`)
tagged("Functions")
shared X(*Args) compose(X(Y) x, Y(*Args) y)
given Args satisfies Anything[]
=> flatten((Args args) => x(y(*args)));
//=> flatten((Args args) => x(unflatten(y)(args)));
© 2015 - 2024 Weber Informatics LLC | Privacy Policy