<div class="gmail_quote">On 10 January 2011 16:13, Daniel Fischer <span dir="ltr">&lt;<a href="mailto:daniel.is.fischer@googlemail.com">daniel.is.fischer@googlemail.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 class="im">On Monday 10 January 2011 16:45:36, Aaron Gray wrote:<br>
&gt;<br>
&gt; This is interesting, what does the following line do :-<br>
&gt;<br>
&gt;     data Int24 = I24# Int# deriving (Eq, Ord)<br>
&gt;<br>
&gt; regarding the I24# and Int#, are these inbuilt ?<br>
<br>
</div>Int# is the raw machine int (4 or 8 bytes) and I24# is the constructor. GHC<br>
uses the magic hash &#39;#&#39; to denote raw unboxed types (and the constructors<br>
making ordinary boxed Haskell types from these, e.g. there&#39;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></blockquote><div><br></div><div>So the 24 bit value is actually stored as a 32bit value. Meaning I will have to do my own IO reader and writer code to a ByteString.</div>

<div><br></div><div>Thanks,</div><div><br></div><div>Aaron</div><div><br></div></div>