1 Jun
2001
1 Jun
'01
10:04 a.m.
While looking through the List module, I came across The unfoldr function undoes a foldr operation. Note that, in general, only invertible functions can be unfolded. [followed by an equation about undoing foldr] This is quite inadequate: unfoldr is very useful with non-invertible functions. I suggest something like: The unfoldr function is a `dual' to foldr: while foldr reduces a list to a summary value, unfoldr builds a list from a seed value, e.g., iterate f == unfoldr (\x -> Just (x, f x)) In some cases unfoldr can undo a foldr operation: [followed by the existing equation]