With a fold, you can describe how to transforming a data structure with multiple elements into a single one. An example would be the sum of numbers in an array. However, working with the more well-known versions of fold, foldRight/reduceRight/etc. is complicated because you usually have two running variables at a time. This workshop explains patterns to make writing folds easier.
Unfolds are the opposite, in math speak the dual, of folds. They construct a data structure from a single element. This pattern is a bit less-known, as it occurs a bit less frequently than folds. A prime example would be to abstract over pagination from an external source, and transform the input into a continuous data structure.
Program Display Configuration
Fri 23 Aug
Displayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Viennachange