> Another issue that I've encountered on the same BLAS project: is there
> an officially sanctioned way to get at the ByteArray# or
> MutableByteArray# underlying the UArray and STUArray types? When I
> import ArrayBase, getting at the ByteArray# of a UArray is no
> problem. However, things are not as simple for an STUArray. I have
> resorted to using my own slightly hacked version of MArray in order to
> get at the MutableByteArray#. Is there some better method to do all
> this?
I'm not sure why you say things aren't as simple for STUArray - the
definition of this datatype is exported from ArrayBase the same as UArray.
Anyway, you're right that there's no easy way to pass these arrays to
foreign functions, like you can with the old MutableArray and ByteArray
types (at least for "unsafe" FFI calls, 'cause the array lives in the
Haskell heap). Now that MArray/IArray have settled down, it's probably
worth adding this support to the compiler.
Cheers,
Simon