Generation and unfolding

O(n) Like unfoldr, unfoldrN builds a stream from a seed
value. However, the length of the result is limited by the
first argument to unfoldrN. This function is more efficient than
unfoldr when the length of the result is known.