[Haskell-beginners] Haskell Serialization

Daniel Fischer daniel.is.fischer at web.de
Mon May 10 15:28:01 EDT 2010


On Monday 10 May 2010 21:00:14, Ashish Agarwal wrote:
> > the Binary class as it is specialized to serializing values for
> > Haskell
>
> only
>
> Can you please expand on this? I've been using Data.Binary to
> (de)serialize messages for some networking protocols, and have made all
> my types instances of Binary. Non-Haskell programs will be receiving and
> sending messages on one end, but I didn't think that mattered since my
> get and put functions are written to adhere to the protocol's
> definition. Is there some issue I'm missing?
>

I think the point was that

derive (.., Binary)

isn't a good idea when communicating with the Non-Haskell part of the 
world. If you write serialisation functions adhering to a specified 
protocol, defining a Binary instance for your types with those functions 
isn't going to do harm.
Only it might give rise to confusion if somebody wants to transmit those 
types according to another protocol.


More information about the Beginners mailing list