Trait frunk_core::hlist::HFoldRightable
[−]
[src]
pub trait HFoldRightable<Folder, Init> { type Output; fn foldr(self, folder: Folder, i: Init) -> Self::Output; }
Foldr for HLists
Associated Types
type Output
Required Methods
fn foldr(self, folder: Folder, i: Init) -> Self::Output
foldr over a data structure
let nil = HNil; assert_eq!(nil.foldr(HNil, 0), 0); let h = hlist![1, false, 42f32]; let folded = h.foldr( hlist![ |i, acc| i + acc, |b: bool, acc| if !b && acc > 42f32 { 9000 } else { 0 }, |f, acc| f + acc ], 1f32 ); assert_eq!(9001, folded)