Solution

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

Let , using the specified operation . Direct evaluation gives , , , and .
Suppose with the same integer result type. The empty list forces . The two singleton calculations force and . But then
contrary to . No such c,b exist. This is the information restriction in the fold factorisation criterion: equal folded tails must remain indistinguishable after the same head is attached. A larger, function-valued result type can retain the missing information, as the continuation representation of a left fold does below.

New to topics? Read the docs here!