Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2013/functional-programming-design-and-analysis-of-algorithms/2/b/solution

Again use structural induction on the finite list. At [], both the right fold and the left fold return the seed . If they agree on zs, then
The third line uses part (a); the fourth uses equation (2). Thus the left-right fold equivalence is
This is a statement about values on finite, total inputs. It does not assert equal evaluation costs or equal behaviour on infinite lists.

New to topics? Read the docs here!