<br><br><div class="gmail_quote">On 10 January 2011 16:36, Antoine Latter <span dir="ltr">&lt;<a href="mailto:aslatter@gmail.com">aslatter@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div><div></div><div class="h5">On Mon, Jan 10, 2011 at 10:17 AM, Aaron Gray &lt;<a href="mailto:aaronngray.lists@gmail.com">aaronngray.lists@gmail.com</a>&gt; wrote:<br>
&gt; On 10 January 2011 16:13, Daniel Fischer &lt;<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>&gt;<br>
&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; On Monday 10 January 2011 16:45:36, Aaron Gray wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; This is interesting, what does the following line do :-<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     data Int24 = I24# Int# deriving (Eq, Ord)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; regarding the I24# and Int#, are these inbuilt ?<br>
&gt;&gt;<br>
&gt;&gt; Int# is the raw machine int (4 or 8 bytes) and I24# is the constructor.<br>
&gt;&gt; GHC<br>
&gt;&gt; uses the magic hash &#39;#&#39; to denote raw unboxed types (and the constructors<br>
&gt;&gt; making ordinary boxed Haskell types from these, e.g. there&#39;s<br>
&gt;&gt;<br>
&gt;&gt; data Int = I# Int#<br>
&gt;&gt; data Word = W# Word#<br>
&gt;&gt; data Double = D# Double#<br>
&gt;&gt;<br>
&gt;&gt; and more defined in base [GHC.Types, GHC.Word]).<br>
&gt;<br>
&gt; So the 24 bit value is actually stored as a 32bit value. Meaning I will have<br>
&gt; to do my own IO reader and writer code to a ByteString.<br>
&gt; Thanks,<br>
&gt; Aaron<br>
&gt;<br>
<br>
</div></div>I don&#39;t think so - the Storable instance provided for the Int24 type<br>
peeks and pokes 24-bit values. At least, that what I understand John&#39;s<br>
earlier message to mean.</blockquote><div><br></div><div>Yes looking at the code it does support 24bit peeks and pokes.</div><div><br></div><div>Thanks,</div><div><br></div><div>Aaron</div><div><br></div></div>