Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export Stats(..) #14

Open
Fuuzetsu opened this issue Nov 19, 2016 · 3 comments
Open

Export Stats(..) #14

Fuuzetsu opened this issue Nov 19, 2016 · 3 comments

Comments

@Fuuzetsu
Copy link

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.

@tibbe
Copy link
Collaborator

tibbe commented Nov 23, 2016

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.

@Fuuzetsu
Copy link
Author

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).

@tibbe
Copy link
Collaborator

tibbe commented Nov 28, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants