composition()
composition<
A,B>(f): <C>(g) => (x) =>B
Pass a value to a function and then the result to another function.
Type Parameters
A
A
The type of the first function's input value. Corresponds to the return type of the second function.
B
B
The return type of first function.
Parameters
f
(z) => B
The second function in the composition.
Returns
<
C>(g): (x) =>B
Type Parameters
C
C
Parameters
g
(y) => A
Returns
(
x):B
Parameters
x
C
Returns
B
Remarks
B combinator
λabc.a(bc)
composition :: (a → b) → (c → a) → c → b
pure function
Example
composition((x) => x + 8)((x) => x * 3)(4);
// 20