Right-associative fold of a structure.
In the case of lists,
foldr, when applied to a binary operator,
a starting value (typically the right-identity of the operator), and a
list, reduces the list using the binary operator, from right to left:
foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)
Note that, since the head of the resulting expression is produced by
an application of the operator to the first element of the list,
foldr can produce a terminating expression from an infinite
list.
For a general
Foldable structure this should be semantically
identical to,
foldr f z = foldr f z . toList