[Haskell-cafe] Problem on overlapping instances
magicloud.magiclouds at gmail.com
Fri Jan 7 09:36:30 CET 2011
I agree, but with a slight difference. Since I am so lazy, if Binary
fits, like 80% of my requirements, for example this case, only
[String] is not OK. I'd like to reuse it with a little modification
made by myself, rather than re-write almost the whole of it.
But for Data.Binary, I think this problem is simple. Since it cannot
be derivinged, making extra function for [String] won't make the
further usage of my library complex.
On Fri, Jan 7, 2011 at 11:32 AM, Antoine Latter <aslatter at gmail.com> wrote:
> I only use the 'Binary' class when I don't care about the specifics of
> the serialization format, only that it be reasonably fast, compact and
> When I need to comply with some particular format I use the functions
> in Data.Binary.Builder and Data.Binary.Get directly. Sometimes I make
> my own Serialize/Deserialize classes if I think it will be helpful.
> But I do look at the source for the instances of the 'Binary' class
> for inspiration!
> Take care,
> On Wed, Jan 5, 2011 at 2:24 AM, Magicloud Magiclouds
> <magicloud.magiclouds at gmail.com> wrote:
>> I am using Data.Binary which defined "instance Binary a => Binary
>> [a]". Now I need to define "instance Binary [String]" to make
>> something special for string list.
>> How to make it work? I looked into the chapter of
>> overlappinginstances, nothing works.
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe