All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ceylon.language.compose.ceylon Maven / Gradle / Ivy

There is a newer version: 1.3.3
Show newest version
"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