
15 Nov
2006
15 Nov
'06
12:46 p.m.
Iavor Diatchki wrote:
Hello, I have two questions about the array APIs in the libraries:
1. Is there a way to write an immutable array to a handle without using any unsafe methods?
In what format? There is no canonical form for an IArray except for Show/Read. If you mean "can I treat the array as a large block of bytes as dump that to a handle?" then you need Data.Array.IO.hPutArray and hGetArray. Or possibly Data.Array.Storable with Foreign.Marshal.Array might help.
2. Why does the function 'getBounds' (of the 'MArray' class) return its result in a monad?
It is so that mutable arrays which dynamically change their bounds can be supported.