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]

[src]

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]

[src]

Use functions to fold a coproduct into a single value. Read more

impl<T: Debug> Debug for Poly<T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<T: Copy> Copy for Poly<T>
[src]

impl<T: Clone> Clone for Poly<T>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<T: Default> Default for Poly<T>
[src]

[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl<T> Send for Poly<T> where
    T: Send

impl<T> Sync for Poly<T> where
    T: Sync