
20 Apr
2005
20 Apr
'05
9:09 p.m.
Hi, I recently needed to access C-like arrays from Haskell. Everyone pointed me to Data.Storable.Array, but that wasn't quite what I wanted. The MArray class that provides the interface for storable arrays insists that it create the storage via newArray or newArray_. But I already had the C storage I needed; I justed wanted to wrap that in Haskell. I cons'ed up my own primitives, which work just fine, but it would be nice to just use something already in the libraries. Concretely, adding a way to create a storable array from an existing Ptr would've done the trick. I can see that's less safe, but sometimes you have to live dangerously! -- Paul