[−][src]Trait frunk::hlist::HMappable
Trait for mapping over an HList
This trait is part of the implementation of the inherent method
HCons::map
. Please see that method for more information.
You only need to import this trait when working with generic
HLists or Mappers of unknown type. If the type of everything is known,
then list.map(f)
should "just work" even without the trait.
Associated Types
type Output
Required methods
fn map(self, mapper: Mapper) -> Self::Output
Apply a function to each element of an HList.
Please see the inherent method for more information.
The only difference between that inherent method and this trait method is the location of the type parameters. (here, they are on the trait rather than the method)
Implementors
impl<F> HMappable<F> for HNil
[src]
impl<F, R, H, Tail> HMappable<F> for HCons<H, Tail> where
F: Fn(H) -> R,
Tail: HMappable<F>,
[src]
F: Fn(H) -> R,
Tail: HMappable<F>,
type Output = HCons<R, <Tail as HMappable<F>>::Output>
fn map(self, f: F) -> <HCons<H, Tail> as HMappable<F>>::Output
[src]
impl<F, R, MapperTail, H, Tail> HMappable<HCons<F, MapperTail>> for HCons<H, Tail> where
F: FnOnce(H) -> R,
Tail: HMappable<MapperTail>,
[src]
F: FnOnce(H) -> R,
Tail: HMappable<MapperTail>,
type Output = HCons<R, <Tail as HMappable<MapperTail>>::Output>
fn map(
self,
mapper: HCons<F, MapperTail>
) -> <HCons<H, Tail> as HMappable<HCons<F, MapperTail>>>::Output
[src]
self,
mapper: HCons<F, MapperTail>
) -> <HCons<H, Tail> as HMappable<HCons<F, MapperTail>>>::Output
impl<P, H, Tail> HMappable<Poly<P>> for HCons<H, Tail> where
P: Func<H>,
Tail: HMappable<Poly<P>>,
[src]
P: Func<H>,
Tail: HMappable<Poly<P>>,