Comment: Re:unfoldr (Score 1) on 2009.01.29 17:42
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. The function takes the element and returns empty list if it is done producing the list or returns (@a,$b), in which case, @a is a appended to the list and $b is used as the next element in a recursive call.
As to the problem as you address it that you need to return two lists, I don't think there is a point to do so, at least for unfoldr, because it transforms a scalar to a list, not a list to a list. A list and a scalar is just fine.
