Struct frunk_core::traits::Poly [−][src]
pub struct Poly<T>(pub T);
Wrapper type around a function for polymorphic maps and folds.
This is a thin generic wrapper type that is used to differentiate
between single-typed generic closures F
that implements, say, Fn(i8) -> bool
,
and a Poly-typed F
that implements multiple Function types
via the Func
trait. (say, Func<i8, Output=bool>
and Func<bool, Output=f32>
)
This is needed because there are completely generic impls for many of the HList traits that take a simple unwrapped closure.
Trait Implementations
impl<P, H, Tail> HMappable<Poly<P>> for HCons<H, Tail> where
P: Func<H>,
Tail: HMappable<Poly<P>>,
[src]
impl<P, H, Tail> HMappable<Poly<P>> for HCons<H, Tail> where
P: Func<H>,
Tail: HMappable<Poly<P>>,
type Output = HCons<<P as Func<H>>::Output, <Tail as HMappable<Poly<P>>>::Output>
fn map(self, poly: Poly<P>) -> Self::Output
[src]
fn map(self, poly: Poly<P>) -> Self::Output
Apply a function to each element of an HList. Read more
impl<P, R, CH, CTail> CoproductFoldable<Poly<P>, R> for Coproduct<CH, CTail> where
P: Func<CH, Output = R>,
CTail: CoproductFoldable<Poly<P>, R>,
[src]
impl<P, R, CH, CTail> CoproductFoldable<Poly<P>, R> for Coproduct<CH, CTail> where
P: Func<CH, Output = R>,
CTail: CoproductFoldable<Poly<P>, R>,
impl<T: Debug> Debug for Poly<T>
[src]
impl<T: Debug> Debug for Poly<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: Copy> Copy for Poly<T>
[src]
impl<T: Copy> Copy for Poly<T>
impl<T: Clone> Clone for Poly<T>
[src]
impl<T: Clone> Clone for Poly<T>
fn clone(&self) -> Poly<T>
[src]
fn clone(&self) -> Poly<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<T: Default> Default for Poly<T>
[src]
impl<T: Default> Default for Poly<T>