Solution
= 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.