Struct naan::fun::curry2::Curry2

source ·
pub struct Curry2<F, A, B, C> { /* private fields */ }
Expand description

A curried function that accepts 2 arguments

Implementations§

source§

impl<F, A, B, C> Curry2<F, Nothing<A>, Nothing<B>, C>where F: F2Once<A, B, Ret = C>,

source

pub fn curry(f: F) -> Self

Curry a binary function

source

pub fn uncurry(self) -> F

Unwrap the Curry2 wrapper, getting the inner function

Trait Implementations§

source§

impl<A, B, C, F> Clone for Curry2<F, A, B, C>where A: Arg + Clone, B: Arg, F: Clone + Fn(A::T, B::T) -> C,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<A, B, const N: usize> Traversable<ArrayVec<N>, A, B, Curry2<fn(_: B, _: ArrayVec<[Option<B>; N]>) -> ArrayVec<[Option<B>; N]>, Just<B>, Nothing<ArrayVec<[Option<B>; N]>>, ArrayVec<[Option<B>; N]>>> for ArrayVec<[Option<A>; N]>where ArrayVec<N>: HKT1<T<B> = ArrayVec<[Option<B>; N]>>,

source§

fn traversem1<Ap, AtoApOfB>( self, f: AtoApOfB ) -> Ap::T<ArrayVec<[Option<B>; N]>>where Ap: HKT1, Self: Foldable<ArrayVec<N>, A>, Ap::T<B>: Applicative<Ap, B> + ApplyOnce<Ap, B>, Ap::T<append1<N, B>>: Applicative<Ap, append1<N, B>> + ApplyOnce<Ap, append1<N, B>>, Ap::T<ArrayVec<[Option<B>; N]>>: Applicative<Ap, ArrayVec<[Option<B>; N]>> + ApplyOnce<Ap, ArrayVec<[Option<B>; N]>>, AtoApOfB: F1<A, Ret = Ap::T<B>>, ArrayVec<N>: HKT1<T<A> = Self>,

Traverse a structure with 0 or more elements, collecting into an Applicative of 0 or 1 elements. Read more
source§

fn traversemm<Ap, AtoApOfB>( self, f: AtoApOfB ) -> Ap::T<ArrayVec<[Option<B>; N]>>where Ap: HKT1, Self: Foldable<ArrayVec<N>, A>, B: Clone, Ap::T<B>: Applicative<Ap, B>, Ap::T<append1<N, B>>: Applicative<Ap, append1<N, B>>, Ap::T<ArrayVec<[Option<B>; N]>>: Applicative<Ap, ArrayVec<[Option<B>; N]>>, AtoApOfB: F1<A, Ret = Ap::T<B>>, ArrayVec<N>: HKT1<T<A> = Self>,

Traverse a structure with 0 or more elements, collecting into an Applicative of 0 or more elements.
source§

impl<A, B> Traversable<Vec, A, B, Curry2<fn(_: B, _: Vec<B, Global>) -> Vec<B, Global>, Just<B>, Nothing<Vec<B, Global>>, Vec<B, Global>>> for Vec<A>

source§

fn traversem1<Ap, AtoApOfB>(self, f: AtoApOfB) -> Ap::T<Vec<B>>where Ap: HKT1, Self: Foldable<Vec, A>, Ap::T<B>: Applicative<Ap, B> + ApplyOnce<Ap, B>, Ap::T<append1<B>>: Applicative<Ap, append1<B>> + ApplyOnce<Ap, append1<B>>, Ap::T<Vec<B>>: Applicative<Ap, Vec<B>> + ApplyOnce<Ap, Vec<B>>, AtoApOfB: F1<A, Ret = Ap::T<B>>, Vec: HKT1<T<A> = Self>,

Traverse a structure with 0 or more elements, collecting into an Applicative of 0 or 1 elements. Read more
source§

fn traversemm<Ap, AtoApOfB>(self, f: AtoApOfB) -> Ap::T<Vec<B>>where Ap: HKT1, Self: Foldable<Vec, A>, B: Clone, Ap::T<B>: Applicative<Ap, B>, Ap::T<append1<B>>: Applicative<Ap, append1<B>>, Ap::T<Vec<B>>: Applicative<Ap, Vec<B>>, AtoApOfB: F1<A, Ret = Ap::T<B>>, Vec: HKT1<T<A> = Self>,

Traverse a structure with 0 or more elements, collecting into an Applicative of 0 or more elements.
source§

fn traverse<Ap, AtoApOfB>(self, f: AtoApOfB) -> Ap::T<F::T<B>>where Ap: HKT1, Self: Sized + Foldable<F, A>, Ap::T<B>: Applicative<Ap, B> + ApplyOnce<Ap, B>, Ap::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>, Ap::T<F::T<B>>: Applicative<Ap, F::T<B>> + ApplyOnce<Ap, F::T<B>>, AtoApOfB: F1<A, Ret = Ap::T<B>>, F: HKT1<T<A> = Self>,

source§

impl<A, B, C, F> Copy for Curry2<F, A, B, C>where A: Arg + Copy, B: Arg, F: Copy + Fn(A::T, B::T) -> C,

Auto Trait Implementations§

§

impl<F, A, B, C> RefUnwindSafe for Curry2<F, A, B, C>where A: RefUnwindSafe, B: RefUnwindSafe, C: RefUnwindSafe, F: RefUnwindSafe,

§

impl<F, A, B, C> Send for Curry2<F, A, B, C>where A: Send, B: Send, C: Send, F: Send,

§

impl<F, A, B, C> Sync for Curry2<F, A, B, C>where A: Sync, B: Sync, C: Sync, F: Sync,

§

impl<F, A, B, C> Unpin for Curry2<F, A, B, C>where A: Unpin, B: Unpin, C: Unpin, F: Unpin,

§

impl<F, A, B, C> UnwindSafe for Curry2<F, A, B, C>where A: UnwindSafe, B: UnwindSafe, C: UnwindSafe, F: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<F, A, TF, T> Sequence<F, A, TF> for T

source§

fn sequence<Ap>(self) -> Ap::T<F::T<A>>where Self: Sized + Traversable<F, Ap::T<A>, A, TF> + Foldable<F, Ap::T<A>>, Ap: HKT1, Ap::T<A>: Applicative<Ap, A> + ApplyOnce<Ap, A>, Ap::T<TF>: Applicative<Ap, TF> + ApplyOnce<Ap, TF>, Ap::T<F::T<A>>: Applicative<Ap, F::T<A>> + ApplyOnce<Ap, F::T<A>>, F: HKT1<T<Ap::T<A>> = Self>,

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.