macro_rules! flip {
($f:expr) => { ... };
}Expand description
Flip arguments of a function flip(f)(x, y) = f(y, x) also known as C (Cardinal) combinator.
ยงExample
use rust2fun::prelude::*;
let f = |x: i32, y: i32| 2 * x + y;
let flipped = flip!(f);
assert_eq!(5, flipped(1, 2));