An unfold function is the opposite (or dual) of a fold. Unfolds recursively generate a list (or other recursive data structure) of values from a seed value.
An unfold function is the opposite (or dual) of a fold. Unfolds recursively generate a list (or other recursive data structure) of values from a seed value.
Unfold functions are often used functional languages which support lazy-evaluation to construct a stream whose values are only created on demand.