[Haskell-cafe] Problem on overlapping instances

Magicloud Magiclouds 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:
> Hello,
>
> 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
> stable.
>
> 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,
> Antoine
>
> On Wed, Jan 5, 2011 at 2:24 AM, Magicloud Magiclouds
> <magicloud.magiclouds at gmail.com> wrote:
>> Hi,
>>  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
>> http://www.haskell.org/mailman/listinfo/haskell-cafe
>>
>



-- 
竹密岂妨流水过
山高哪阻野云飞



More information about the Haskell-Cafe mailing list