iterateN package:massiv

Sequentially iterate over each cell in the array in the row-major order while continuously aplying the accumulator at each step.

Example

>>> import Data.Massiv.Array

>>> iterateN (Sz2 2 10) succ (10 :: Int)
Array DL Seq (Sz (2 :. 10))
[ [ 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 ]
, [ 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ]
]
Same as iterateN, but with index aware function.
Create a delayed stream vector of length n by repeatedly applying a function to the initial value.

Examples

>>> siterateN 10 succ 'a'
Array DS Seq (Sz1 10)
[ 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' ]
Create a delayed stream vector of length n by repeatedly apply a monadic action to the initial value.

Examples