
8 Feb
2006
8 Feb
'06
6:20 a.m.
Bulat Ziganshin wrote:
Hello Chris,
Wednesday, February 08, 2006, 2:35:39 AM, you wrote:
CK> You probably want Foreign.Marshal.Array
CK> http://www.haskell.org/ghc/docs/6.4.1/html/libraries/base/Foreign-Marshal-Ar...
CK> peekArray :: Storable a => Int -> Ptr a -> IO [a]
i think we should define "secret door" to construct StorableArray from a pointer to allow to use full power of MArray interface on foreign arrays
You mean this? -- |Construct a 'StorableArray' from an arbitrary 'ForeignPtr'. It is -- the caller's responsibility to ensure that the 'ForeignPtr' points to -- an area of memory sufficient for the specified bounds. unsafeForeignPtrToStorableArray :: ForeignPtr e -> (i,i) -> IO (StorableArray i e) Cheers, Simon