unfoldl package:containers

unfoldl f x is equivalent to reverse (unfoldr (fmap swap . f) x).