Open Fuuzetsu opened 7 years ago
It's not exposed because I want to be able to change the implementation (e.g. to add support for quantiles). However, I am open to adding e.g. Binary
instances or explicit decode
/encode
methods that could be used to transport stats over the network.
That would work too. I didn't see binary
dependency (though it's probably a transitive one) so I assumed exposing constructor would be less of a change.
Generic
and Typeable
would be nice too while you're changing it (from base
).
I think depending on binary is OK. If we don't want to commit to a specific library we could instead just offer:
encodeStats :: Stats -> ByteString
decodeStats :: ByteString -> Maybe Stats
This would allow us to change to use cereal or whatever in the future.
Having
Stats
exposed would be useful. Currently it can't be sent over the network unless it's rebuilt from scratch through its accessors, we can't write instances for it and so on.