[Haskell-cafe] Bit fiddling

robert dockins robdockins at fastmail.fm
Tue May 17 17:20:45 EDT 2005


If you want C compatibility, you need

http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Array.Storable.html

which is similar.  You then use the "withStorableArray" to call out to 
your C functions.


Florian Weimer wrote:

> * robert dockins:
> 
> 
>>Probably you have seen this already, but I thought I'd mention it on the 
>>off-chance you missed it:
>>
>>http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Bits.html
>>http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data.Word.html
>>
>>Probably you'll want to think about an IOUArray of Word8, or something 
>>similar.
> 
> 
> IOUArray looks indeed interesting, thanks.  How can I pass such
> objects (in particular of type IOUArray Int Word8) to a C routine,
> preferably as a void */size_t combination?



More information about the Haskell-Cafe mailing list