iterate -base -package
iterate f x returns an infinite ByteString of repeated applications of f to x:
> iterate f x == [x, f x, f (f x), ...]
iterate f x returns an infinite ByteString of repeated applications of f to x:
> iterate f x == [x, f x, f (f x), ...]
O(n). Constructs a sequence by repeated application of a function to a seed value.
> iterateN n f x = fromList (Prelude.take n (Prelude.iterate f x))