ulkb.util.foldr_infix#

foldr_infix(f, g, arg1, arg2, *args, **kwargs)[source]#

Right-fold variant used to apply infix operators.

For example:

foldr_infix(f, g, [1,2,3,4,5], **kwargs)

is equivalent to:

f(1, g(2, g(3, g(4, 5))), **kwargs)