
17 Nov
2006
17 Nov
'06
8:35 p.m.
iavor.diatchki:
Hello,
I am aware of the unsafe methods to cast arrays. My question was if there was a function in the libraries to dump an immutable array of bytes to a handle, that is safe (it could, of course, be implemented behind the scene using unsafe primitives, however, this is implementation specific). My impression was that there isn't one, and I guess you are confirming this. I think it would be useful to have such a function in the libraries.
If its arrays of bytes only you're working with, you might use Data.ByteString. Malcolm found it to be a bit faster than UArrays of Word8, if I recall, and it has lots of IO operations. -- Don