iterateN package:contiguous

Apply a function n times to a value and construct an array where each consecutive element is the result of an additional application of this function. The zeroth element is the original value.
iterateN 5 (+ 1) 0 = fromListN 5 [0,1,2,3,4]