unfoldr package:dlist

unfoldr f z is the DList constructed from the recursive application of f. The recursion starts with the seed value z and ends when, for some z' : b, f z' == Nothing. <math>(length (unfoldr f z)). unfoldr obeys the law:
toList (unfoldr f z) = unfoldr f z
unfoldr f z is the DNonEmpty constructed from the recursive application of f. The recursion starts with the seed value z and ends when, for some z' : b, f z' == Nothing. <math>(length (unfoldr f z)). unfoldr obeys the law:
toNonEmpty (unfoldr f z) = unfoldr f z