foldr package:dlist

foldr f z xs is the right-fold of f over xs. <math>(length (toList xs)). foldr obeys the law:
foldr f z xs = foldr f z (toList xs)
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