Passing a matrix from C to Haskell

Cyril Schmidt cschmidt at
Wed Feb 8 11:33:31 EST 2006

Simon Marlow wrote:
> Bulat Ziganshin wrote:
>> 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)

It looks like this function is not available in GHC 6.4.1 (see

It is, however, documented at
but I don't know which version of GHC it applies to.



More information about the Glasgow-haskell-users mailing list