Kaya 0.4.4 reference for Prelude::compose

List of functions and data types in Prelude

a(c) compose(a(b) f, b(c) g)

Arguments

Usage

Compose two functions: compose(f,g)(x) == f(g(x)).

Float double(Float x) {
    return x*2.0;
}
Int roundDown(Float y) {
    return Int(floor(y));
}
Void main() {
    combined = compose(roundDown,double);
    a = combined(3.6);
    // a = 7
}
kaya@kayalang.org | Last modified 29 November 2011 | Supported by Durham CompSoc | Powered by Kaya