Ticket #21 (closed enhancement: fixed)
Add another form of unfoldr
|Reported by:||Khudyakov||Owned by:|
Please add following functions for construction of immutable vectors. They are useful for generation of n first element like power series, sequence defined as recurrent relation etc.
iterate :: Int -> (a -> a) -> a -> Vector a -- I can't think of nice name (unfoldrN is taken already) unfoldrN2 :: Int -> (b -> (a,b)) -> b -> Vector a
Clearly they are specializations of unfoldr. I think they are quite useful especially first one. Second function could be easily defined in terms of unfoldrN but it should be advantageous from perfomance point of view. There is no need to wrap/unwrap value to/from Maybe.