<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); ">>> get (0::Word8)<br>>> getWord8be 0<br>
> </div>> Make that<br>> <br>> put (0 :: Word16)<br>> putWord16be 0<br>> <br>> ?</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've been grappling with, supporting multiple versions of the protocol. Probably I'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"><<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>></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>
> On 11 May 2010 19:16, Daniel Fischer <<a href="mailto:daniel.is.fischer@web.de">daniel.is.fischer@web.de</a>> wrote:<br>
> > Int8 and Word8 are unproblematic (unless you have a ones-complement<br>
> > machine), the problems appear only for larger types, [SNIP]<br>
><br>
> Hi Daniel<br>
><br>
> Likely I was revealing a personal bias on that one, the only protocol<br>
> I've implemented where Int8 has featured has been MIDI.<br>
><br>
> If MIDI isn't ones-complement, my codes - I've written decoders /<br>
> encoders several times - have been wrong for years...<br>
<br>
</div>I'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>
><br>
> Best wishes<br>
><br>
> 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>