[][src]Trait frunk::hlist::HFoldRightable

pub trait HFoldRightable<Folder, Init> {
    type Output;
    fn foldr(self, folder: Folder, i: Init) -> Self::Output;
}

Trait for performing a right fold over an HList

This trait is part of the implementation of the inherent method HCons::foldr. Please see that method for more information.

You only need to import this trait when working with generic HLists or Folders of unknown type. If the type of everything is known, then list.foldr(f, init) should "just work" even without the trait.

Associated Types

type Output

Loading content...

Required methods

fn foldr(self, folder: Folder, i: Init) -> Self::Output

Perform a right fold over 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)

Loading content...

Implementors

impl<'a, F, R, H, Tail, Init> HFoldRightable<&'a F, Init> for HCons<H, Tail> where
    F: Fn(H, <Tail as HFoldRightable<&'a F, Init>>::Output) -> R,
    Tail: HFoldRightable<&'a F, Init>, 
[src]

type Output = R

impl<F, FolderHeadR, FolderTail, H, Tail, Init> HFoldRightable<HCons<F, FolderTail>, Init> for HCons<H, Tail> where
    F: FnOnce(H, <Tail as HFoldRightable<FolderTail, Init>>::Output) -> FolderHeadR,
    Tail: HFoldRightable<FolderTail, Init>, 
[src]

type Output = FolderHeadR

impl<F, Init> HFoldRightable<F, Init> for HNil[src]

type Output = Init

Loading content...