Trait frunk::hlist::HFoldRightable
source · pub trait HFoldRightable<Folder, Init> {
type Output;
// Required method
fn foldr(self, folder: Folder, i: Init) -> Self::Output;
}
Expand description
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.
Required Associated Types§
Required Methods§
sourcefn foldr(self, folder: Folder, i: Init) -> Self::Output
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)