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
(A
)
Type Parameters
• A
Parameters
a
A
The value to pass to the function.
Returns
Function
Type Parameters
• B
Parameters
b
(x
) => B
Returns
B
Remark
Th combinator
Remark
applyTo :: a → (a → b) → b
Remark
λab.ba
Remarks
pure function
Example
applyTo(6)(x => x * 2);
// 12