Passing arrays between Haskell and C without overhead

Bulat Ziganshin bulat.ziganshin at
Sun Nov 26 13:46:41 EST 2006

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:

you should use StorableArray. also, i suggest you to use ghc 6.6
because it has much faster foreign ptrs implementation. you may also
consider using my ArrayRef lib, although from that you said i don't
see that you will get any advantages from this

Best regards,
 Bulat                            mailto:Bulat.Ziganshin at

More information about the Glasgow-haskell-users mailing list