<div><br></div><br><br><div class="gmail_quote">On Thu, May 14, 2009 at 8:46 PM, Don Stewart <span dir="ltr">&lt;<a href="mailto:dons@galois.com">dons@galois.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
leimy2k:<br>
<div><div></div><div class="h5">&gt;<br>
&gt;<br>
&gt; On Thu, May 14, 2009 at 8:40 PM, Don Stewart &lt;<a href="mailto:dons@galois.com">dons@galois.com</a>&gt; wrote:<br>
&gt;<br>
&gt;     leimy2k:<br>
&gt;     &gt; I actually need little endian encoding... wondering if anyone else hit<br>
&gt;     this<br>
&gt;     &gt; with Data.Binary. (because I&#39;m working with Bell Lab&#39;s 9P protocol which<br>
&gt;     does<br>
&gt;     &gt; encode things on the network in little-endian order).<br>
&gt;     &gt;<br>
&gt;     &gt; Anyone got some &quot;tricks&quot; for this?<br>
&gt;<br>
&gt;     Yes!<br>
&gt;     There are big, little and host-endian primitives in the Get/Put monads.<br>
&gt;<br>
&gt;        <a href="http://hackage.haskell.org/packages/archive/binary/0.5.0.1/doc/html/" target="_blank">http://hackage.haskell.org/packages/archive/binary/0.5.0.1/doc/html/</a><br>
&gt;     Data-Binary-Put.html#v%3AputWord16le<br>
&gt;<br>
&gt;     You can use these to build encoders directly.<br>
&gt;<br>
&gt;<br>
&gt; Cool... I just have to write my own encoder and decoder now.<br>
&gt;<br>
&gt; As a request could we get encodeLe decodeLe for a later version of this<br>
&gt; library?  :-)  That&#39;d be totally awesome.<br>
<br>
</div></div>Oh, you mean entirely different instances for all the current ones, that<br>
use LE encodings?<br></blockquote><div><br></div><div>Well the library is leaning towards &quot;Network Byte Order&quot; in that it has encode/decode that only encode/decode for Big Endian.</div><div><br></div><div>Us folks who have to do little endian all now have to write our own encoding/decoding :-)</div>
<div><br></div><div>I&#39;m speaking specifically of the encode/decode functions.  I have no idea how they&#39;re implemented.</div><div><br></div><div>Are you saying that encode is doing something really simple and the default encodings for things just happen to be big endian?  If so, then I understand the pain.... but it still means I have to roll my own :-)  I guess if one must choose, big endian kind of makes sense, except that the whole world is little endian now, except for networks :-)  (No one *really* cares about anything but x86 anyway these days right?)</div>
<div><br></div><div>I&#39;m only half-kidding.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font color="#888888"><br>
-- Don<br>
</font></blockquote></div><br>