applyTo()
applyTo<
A>(a): <B>(b) =>B
Takes an argument and an unary function and then applies the function to the argument.
Inverse of apply.
Type Parameters
A
A
The type of input value.
Parameters
a
A
The value to pass to the function.
Returns
<
B>(b):B
Type Parameters
B
B
Parameters
b
(x) => B
Returns
B
Remarks
Th combinator
λab.ba
applyTo :: a → (a → b) → b
pure function
Example
applyTo(6)(x => x * 2);
// 12