
On Feb 20, 2008 12:59 PM, Chad Scherrer
On Feb 20, 2008 10:57 AM, Antoine Latter
wrote: For anyone looking into it - the StorableVector fusion would have to be quite different from the current ByteString fusion framework. Maybe it would be enough to lay down a Stream fusion framework for StorableVectors.
I must be missing something. Why would it have to be so different?
From what I saw of Data.ByteString.Fusion, it relies on the assumption
that the elements of the output array are of the same size and alignment as the elements of all of the arrays in the fused intermediate steps. That way, all of the intermediate stages can mutate the output array in place. This works because all of the fusable bytestring functions have types along the lines of: map :: (Word8 -> Word8) -> ByteString -> ByteString With StorableVector, it'd be nice to support the fusion of: map :: (a -> b) -> Vector a -> Vector b All of this just comes from me reading the code, so I could be miss-interpreting something. The NDP papers probably have something interesting to say about this, but I haven't taken the time to try and understand/simplify what they do. -Antoine