Function rust2fun::combinator::apply
source · pub fn apply<T, R>(f: impl FnOnce(T) -> R, x: T) -> R
Expand description
The apply function apply(f, x) = f(x) also known as A (Apply) combinator. It is the same as function application.
Example
use rust2fun::prelude::*;
let actual = apply(|x| x + 1, 2);
assert_eq!(3, actual);