Passing arrays between Haskell and C without overhead

2006-11-26 Thread Brian Hulley
Hi, For a 3d graphics library, I'd like to have a 4x4 matrix of floats which I can pass from Haskell to C without having to copy all 16 floats each time, something like: data Mat44f = Mat44f Float# Float# ... Float# foreign import ccall c_setWorldTransform :: Ptr Mat44f - IO ()

Re: Passing arrays between Haskell and C without overhead

2006-11-26 Thread Brian Hulley
Bulat Ziganshin wrote: Hello Brian, Sunday, November 26, 2006, 5:34:51 PM, you wrote: For a 3d graphics library, I'd like to have a 4x4 matrix of floats which I can pass from Haskell to C without having to copy all 16 floats each time, something like: