lisa.utils: Add foldr()
Add right-associative version of functools.reduce(), so that: [a, b, c, d] is turned into f(a, f(b, f(c, f(d, init)))) instead of f(f(f(f(init, a), b), c), d)
Loading
Please register or sign in to comment
Add right-associative version of functools.reduce(), so that: [a, b, c, d] is turned into f(a, f(b, f(c, f(d, init)))) instead of f(f(f(f(init, a), b), c), d)