Ticket #15 (new enhancement)
Add "generalised scan"
|Reported by:||rl||Owned by:|
In any case, vector could well provide an operation like this:
cant_think_of_a_name :: Vector v a => Int -> (v a -> a) -> v a
The function would take the initialised prefix of the vector (starting with empty) and produce the next element. This would require a bit of hackery underneath but the interface would be safe and pure. Would something like this be useful?
Note that we can't unsafeFreeze the vector until we are done because that would break GC for boxed vectors. Also, we can't recycle the vector because a could be a thunk with references to the intermediate v a.