Solution

ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2017/functional-programming-design-and-analysis-of-algorithms-resit/4/a/solution

The most general polymorphic type is
unfold :: (s -> Bool) -> (s -> a) -> (s -> s) -> s -> [a]
The stopping predicate consumes a state, the output function turns that state into one list element, and the transition function supplies another state of the same type. The state type and output type need not coincide. This is a list unfold with separate stopping, output and transition arguments.

New to topics? Read the docs here!