<span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><div class="im" style="color: rgb(80, 0, 80); ">&gt;&gt;     get (0::Word8)<br>&gt;&gt;     getWord8be 0<br>

&gt; </div>&gt; Make that<br>&gt; <br>&gt; put (0 :: Word16)<br>&gt; putWord16be 0<br>&gt; <br>&gt; ?</span><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>

</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Yes, thanks for the correction. Word8 was a bad choice since endianness is not an issue.</span></font></div>

<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Thanks for all the advice. It seems I should avoid making my types instances of Binary. In fact, this relates to another design issue I&#39;ve been grappling with, supporting multiple versions of the protocol. Probably I&#39;ll need something like, putProtVersion1, putProtVersion2, etc. Or something along this line.</span></font></div>

<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br>

</span></font></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; "><br></span><br><div class="gmail_quote">On Tue, May 11, 2010 at 3:41 PM, Daniel Fischer <span dir="ltr">&lt;<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</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 Tuesday 11 May 2010 21:01:19, Stephen Tetley wrote:<br>
&gt; On 11 May 2010 19:16, Daniel Fischer &lt;<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>&gt; wrote:<br>
&gt; &gt; Int8 and Word8 are unproblematic (unless you have a ones-complement<br>
&gt; &gt; machine), the problems appear only for larger types, [SNIP]<br>
&gt;<br>
&gt; Hi Daniel<br>
&gt;<br>
&gt; Likely I was revealing a personal bias on that one, the only protocol<br>
&gt; I&#39;ve implemented where Int8 has featured has been MIDI.<br>
&gt;<br>
&gt; If MIDI isn&#39;t ones-complement, my codes - I&#39;ve written decoders /<br>
&gt; encoders several times - have been wrong for years...<br>
<br>
</div>I&#39;ve no idea how MIDI messages/files/streams are interpreted, I was<br>
thinking about the hardware, how the ALU interprets the bit-pattern for<br>
arithmetic.<br>
<div><div></div><div class="h5"><br>
&gt;<br>
&gt; Best wishes<br>
&gt;<br>
&gt; Stephen<br>
<br>
_______________________________________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/beginners" target="_blank">http://www.haskell.org/mailman/listinfo/beginners</a><br>
</div></div></blockquote></div><br></div>