Trait naan::fun::F2Once

source ·
pub trait F2Once<A, B>: Sized {
    type Ret;
    type Curried;

    // Required methods
    fn call1(self, a: A, b: B) -> Self::Ret;
    fn curry(self) -> Self::Curried;
}
Expand description

A function that accepts 2 arguments and can be called at most once.

Required Associated Types§

source

type Ret

The type returned by this function

source

type Curried

The concrete type that curry returns.

Required Methods§

source

fn call1(self, a: A, b: B) -> Self::Ret

Call the function

source

fn curry(self) -> Self::Curried

Curry this function, transforming it from fn(A, B) -> C to fn(A) -> fn(B) -> C

Implementors§

source§

impl<F, A, B, C> F2Once<A, B> for Fwhere F: FnOnce(A, B) -> C,

§

type Ret = C

§

type Curried = Curry2<F, Nothing<A>, Nothing<B>, C>