Using the specified list unfold, the definitions are
map f = unfold null (f . head) tail
iterate f = unfold (const False) id fFor
map, the current state is the remaining input list. null prevents head and tail from being evaluated on an empty list. For iterate, the stop predicate is always false and the output is the current state itself. Its transition is f, so the original seed is emitted before the first application of f. Articles by others on the same topic
There are currently no matching articles.