This library has practically every type parameterised on two type variables, 'i' and 'a'.
Simplified view: i represents a key, a represents a value.
The only thing we ever assume about i and a are that they have Serialize instances, but there's no reason to do it that way rather than to just have two concrete newtypes over ByteString, called Key and Value, and then write a wrapper module that uses Serialize.
I think it's not only unnecessary, but this design is worse. The current approach encourages orphan instances, makes code harder to read, and removes opportunities for optimisation.
This library has practically every type parameterised on two type variables, 'i' and 'a'.
Simplified view:
irepresents a key,arepresents a value.The only thing we ever assume about
iandaare that they haveSerializeinstances, but there's no reason to do it that way rather than to just have two concrete newtypes overByteString, calledKeyandValue, and then write a wrapper module that usesSerialize.I think it's not only unnecessary, but this design is worse. The current approach encourages orphan instances, makes code harder to read, and removes opportunities for optimisation.