<br><br><div class="gmail_quote">On 10 January 2011 16:36, Antoine Latter <span dir="ltr"><<a href="mailto:aslatter@gmail.com">aslatter@gmail.com</a>></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 <<a href="mailto:aaronngray.lists@gmail.com">aaronngray.lists@gmail.com</a>> wrote:<br>
> On 10 January 2011 16:13, Daniel Fischer <<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.com</a>><br>
> wrote:<br>
>><br>
>> On Monday 10 January 2011 16:45:36, Aaron Gray wrote:<br>
>> ><br>
>> > This is interesting, what does the following line do :-<br>
>> ><br>
>> > data Int24 = I24# Int# deriving (Eq, Ord)<br>
>> ><br>
>> > regarding the I24# and Int#, are these inbuilt ?<br>
>><br>
>> Int# is the raw machine int (4 or 8 bytes) and I24# is the constructor.<br>
>> GHC<br>
>> uses the magic hash '#' to denote raw unboxed types (and the constructors<br>
>> making ordinary boxed Haskell types from these, e.g. there's<br>
>><br>
>> data Int = I# Int#<br>
>> data Word = W# Word#<br>
>> data Double = D# Double#<br>
>><br>
>> and more defined in base [GHC.Types, GHC.Word]).<br>
><br>
> So the 24 bit value is actually stored as a 32bit value. Meaning I will have<br>
> to do my own IO reader and writer code to a ByteString.<br>
> Thanks,<br>
> Aaron<br>
><br>
<br>
</div></div>I don'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'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>