
10 May
2010
10 May
'10
5:49 p.m.
Hi Ashish Daniel has largely answered this for me (thanks Daniel!). If you define Binary instances for your data types to match a protocol - then as Daniel says you can only use them for that protocol. Similarly the all the regular Haskell types - Int, Word8, Float, etc. - have Binary instances ready-made which you may not want when dealing with anything non-Haskell [*]: numbers are always big-endian, the encodings for Integers, Floats and the like are sparsely documented and may well handle signs differently to an equivalent C / Java / ... representation. [*] Personally I'd go as far as saying, as saying you should avoid them entirely except for writing other instances of the Binary class. Best wishes Stephen