Ticket #15 (new enhancement)
Add "generalised scan"
| Reported by: | rl | Owned by: | |
|---|---|---|---|
| Priority: | minor | Milestone: | |
| Version: | 0.7 | Keywords: | |
| Cc: |
Description
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?
See http://www.haskell.org/pipermail/glasgow-haskell-users/2010-May/018816.html
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.
Change History
Note: See
TracTickets for help on using
tickets.
