Hi Brandon,<br><br>Thanks for your help, CString will work great for Char arrays, but what about the 16bit-Word arrays? I was not clear in my previous post but the structures used in the nwrfcsdk library can use 8bit or 16 bit &quot;chars&quot; depending on a #define (#define SAPwithUNICODE).<br>
<br>Reading another post on FFI in this mailing list I found a link to the following page <a href="http://haskell.org/haskellwiki/Modern_array_libraries">http://haskell.org/haskellwiki/Modern_array_libraries</a> with a section on StorableArrayS. I&#39;m now trying to use this example code to get StorableArray to work.<br>
<br>I will try to use Data.Encoding to convert Haskell StringS to ASCII or UTF16 ByteStringS. Then unpack those ByteStringS to Word8 list and populate StorableArrayS with the bytes. I hope it&#39;ll do the job for both Word8 and Word16 arrays.<br>
<br>Olivier.<br><br><div class="gmail_quote">On Fri, May 9, 2008 at 9:52 AM, Brandon S. Allbery KF8NH &lt;<a href="mailto:allbery@ece.cmu.edu">allbery@ece.cmu.edu</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div style=""><div class="Ih2E3d"><br><div><div>On 2008 May 9, at 9:42, Olivier Boudry wrote:</div><br><blockquote type="cite">Of course it won&#39;t work as HArrayStruct in file HArrayStruct.hs uses Strings and String is not an instance of Storable.<br>
 <br>Ideally I would need some sort of Storable array of char. Is Data.Storable.Array the type I&#39;m looking for? Could someone point me to some code using the same kind of structures?<br></blockquote></div><div><br></div>
</div><div>You want CString (Foreign.C.String).</div><br><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div style="">
<span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
<font face="Monaco"><span style="font-family: Monaco;"><span style="font-family: Monaco;">--&nbsp;</span></span></font></div><div><font face="Monaco"><span style="font-family: Monaco;"><span style="font-family: Monaco;">brandon s. allbery [solaris,freebsd,perl,pugs,haskell] <a href="mailto:allbery@kf8nh.com" target="_blank">allbery@kf8nh.com</a></span></span></font></div>
<div><font face="Monaco"><span style="font-family: Monaco;"><span style="font-family: Monaco;">system administrator [openafs,heimdal,too many hats] <a href="mailto:allbery@ece.cmu.edu" target="_blank">allbery@ece.cmu.edu</a></span></span></font></div>
<div><font face="Monaco"><span style="font-family: Monaco;"><span style="font-family: Monaco;">electrical and computer engineering, carnegie mellon university &nbsp; &nbsp;KF8NH</span></span></font></div><span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><br>
</span></span></span></div></span> </div><br></div></blockquote></div><br>