Folds the elements of list from right.
Applying foldR to infinite structures usually doesn't terminate. But it may still terminate under one of the following conditions:
foldR
The fold operation.
The folded value.
expect( foldR((x: string) => (y: string) => x + y)("")(fromString("hoge")),).toStrictEqual( "hoge",);expect( foldR((x: string) => (y: string) => y + x)("")(fromString("")),).toStrictEqual( "",); Copy
expect( foldR((x: string) => (y: string) => x + y)("")(fromString("hoge")),).toStrictEqual( "hoge",);expect( foldR((x: string) => (y: string) => y + x)("")(fromString("")),).toStrictEqual( "",);
Folds the elements of list from right.
Applying
foldRto infinite structures usually doesn't terminate. But it may still terminate under one of the following conditions: