1Prelude.compose(3kaya)       Kaya module reference      Prelude.compose(3kaya)
2
3
4

NAME

6       Prelude::compose - Compose two functions.
7

SYNOPSIS

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

ARGUMENTS

12       f The first function to compose
13
14       g The second function to compose
15

DESCRIPTION

17       Compose two functions: compose(f,g)(x) == f(g(x))
18
19
20
21    Float double(Float x) {
22        return x*2.0;
23    }
24    Int roundDown(Float y) {
25        return Int(floor(y));
26    }
27    Void main() {
28        combined = compose(roundDown,double);
29        a = combined(3.6);
30        // a = 7
31    }
32

AUTHORS

34       Kaya   standard  library  by  Edwin  Brady,  Chris  Morris  and  others
35       (kaya@kayalang.org). For further information see http://kayalang.org/
36

LICENSE

38       The Kaya standard library is free software;  you  can  redistribute  it
39       and/or  modify  it  under  the  terms  of the GNU Lesser General Public
40       License (version 2.1 or any later version) as  published  by  the  Free
41       Software Foundation.
42
43
44
45Kaya                             December 2010          Prelude.compose(3kaya)
Impressum