Passing a matrix from C to Haskell

Bulat Ziganshin bulatz at
Wed Feb 8 14:02:10 EST 2006

Hello Cyril,

Wednesday, February 08, 2006, 7:39:51 PM, you wrote:

>> peekArray :: Storable a => Int -> Ptr a -> IO [a]
CS> This works, but peekArray is very slow.

use the attached module. this will allow you to use usafeRead/unsafeWrite

i written it while i'm online so it can contain any mumber of bugs ;)

ps: btw, if you know russian - i know it too ;)

Best regards,
 Bulat                            mailto:bulatz at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ForeignArray.hs
Type: application/octet-stream
Size: 3016 bytes
Desc: not available
Url :

More information about the Glasgow-haskell-users mailing list