
On Thu, Jul 15, 2004 at 04:26:27AM -0700, John Meacham wrote:
I am thinking a family of routines. (with psuedosignatures)
copySpan: range -> MArray -> whereto -> MArray -> m () extractSpan : range -> IArray -> IArray extractSpanM : range -> MArray -> m IArray saveSpan : range -> IArray -> whereto -> MArray -> m ()
I would like to have these, too. I would especially like to have saveSpan :: (Int, Int) -> UArray Int Word8 -> (Int, Int) -> IOUArray Int Word8 -> IO () copySpan :: (Int, Int) -> IOUArray Int Word8 -> (Int, Int) -> IOUArray Int Word8 -> IO () to use these in conjunction with hGetArray and hPutArray. In the hope of advancing the discussion, I have taken up the trivial task of implementing the above on top of the usual array functions. (I have not done any testing, though.) Maybe some kind soul with knowledge of the ghc innards can provide an implementation that reduces to a memcpy call, at least for some specializations. Greetings, Carsten -- Carsten Schultz (2:38, 33:47), FB Mathematik, FU Berlin http://carsten.codimi.de/ PGP/GPG key on the pgp.net key servers, fingerprint on my home page.