Skip to main content

untupled

Function untupled 

Source
pub fn untupled<A, B, C>(f: impl Fn((A, B)) -> C) -> impl Fn(A, B) -> C
Expand description

Function.untupled — convert a function that takes a tuple into a two-argument function.

use effectful::func::untupled;
let sum_pair = |(a, b): (i32, i32)| a + b;
let two_arg = untupled(sum_pair);
assert_eq!(two_arg(3, 4), 7);