Passing a matrix from C to Haskell
Simon Marlow
simonmar at microsoft.com
Wed Feb 8 12:10:21 EST 2006
Cyril Schmidt wrote:
> 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
> http://www.haskell.org/ghc/docs/6.4.1/html/libraries/base/Data-Array-Storable.html
> )
>
> It is, however, documented at
> http://www.haskell.org/HOpenGL/newAPI/base/Foreign-Storable.html
> but I don't know which version of GHC it applies to.
Yes, it's new since 6.4.x. It will be in 6.6.
Cheers,
Simon
More information about the Glasgow-haskell-users
mailing list