{"action":"created","issue":{"url":"https://api.github.com/repos/IreneKnapp/direct-murmur-hash/issues/3","labels_url":"https://api.github.com/repos/IreneKnapp/direct-murmur-hash/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/IreneKnapp/direct-murmur-hash/issues/3/comments","events_url":"https://api.github.com/repos/IreneKnapp/direct-murmur-hash/issues/3/events","html_url":"https://github.com/IreneKnapp/direct-murmur-hash/issues/3","id":127561818,"number":3,"title":"Consider using hashabler to support hashing arbitrary types?","user":{"login":"jberryman","id":210815,"avatar_url":"https://avatars.githubusercontent.com/u/210815?v=3","gravatar_id":"","url":"https://api.github.com/users/jberryman","html_url":"https://github.com/jberryman","followers_url":"https://api.github.com/users/jberryman/followers","following_url":"https://api.github.com/users/jberryman/following{/other_user}","gists_url":"https://api.github.com/users/jberryman/gists{/gist_id}","starred_url":"https://api.github.com/users/jberryman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jberryman/subscriptions","organizations_url":"https://api.github.com/users/jberryman/orgs","repos_url":"https://api.github.com/users/jberryman/repos","events_url":"https://api.github.com/users/jberryman/events{/privacy}","received_events_url":"https://api.github.com/users/jberryman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-19T23:13:45Z","updated_at":"2016-02-01T22:06:02Z","closed_at":null,"body":"Would you be interested in merging changes that permitted hashing of arbitrary [`Hashable`](http://hackage.haskell.org/package/hashabler-1.2.1/docs/Data-Hashabler.html#t:Hashable) types from my `hashabler` package? The resulting hash functions would look something like:\r\n\r\n    hash :: Hashable a=> a -> Hash\r\n\r\nwhere `a` may also be `ByteString`. This would allow hashing of arbitrary haskell values in a performant way (without needing to marshal to a bytestring first), and cross-platform consistent way, etc.\r\n\r\nI'm not sure when I'd be able to get to this, but I wanted to float the idea first. Let me know if you're interested and would like more details about what that might look like."},"comment":{"url":"https://api.github.com/repos/IreneKnapp/direct-murmur-hash/issues/comments/178220629","html_url":"https://github.com/IreneKnapp/direct-murmur-hash/issues/3#issuecomment-178220629","issue_url":"https://api.github.com/repos/IreneKnapp/direct-murmur-hash/issues/3","id":178220629,"user":{"login":"IreneKnapp","id":157678,"avatar_url":"https://avatars.githubusercontent.com/u/157678?v=3","gravatar_id":"","url":"https://api.github.com/users/IreneKnapp","html_url":"https://github.com/IreneKnapp","followers_url":"https://api.github.com/users/IreneKnapp/followers","following_url":"https://api.github.com/users/IreneKnapp/following{/other_user}","gists_url":"https://api.github.com/users/IreneKnapp/gists{/gist_id}","starred_url":"https://api.github.com/users/IreneKnapp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IreneKnapp/subscriptions","organizations_url":"https://api.github.com/users/IreneKnapp/orgs","repos_url":"https://api.github.com/users/IreneKnapp/repos","events_url":"https://api.github.com/users/IreneKnapp/events{/privacy}","received_events_url":"https://api.github.com/users/IreneKnapp/received_events","type":"User","site_admin":false},"created_at":"2016-02-01T22:06:02Z","updated_at":"2016-02-01T22:06:02Z","body":"I looked through your package and I do think it's got a reasonable goal. In principle, I'm willing to be persuaded that this is a good idea.\r\n\r\nI'm a little conflicted as to whether it's really best to do this in a way that makes each hash-function package depend on hashabler - that's how this would have to work, right? My concern is primarily that there is more than one strategy possible for serializing Haskell values, and in fact there's a lot of packages existing that do that in various ways for various purposes, and there are a lot of design pitfalls which they can fall into. Picking a point in that design space and tightly coupling a hash-function implementation to it is somewhat unappealing. I know that users who would prefer their own way could go via ByteString, but that doesn't really make me happy about adding a dependency that some users will have to work around.\r\n\r\nThinking about it more, it occurs to me that using a Hashable ByteString instance as the \"raw\" interface is a bit strange. It works, given that your particular recommended serialization strategy isn't attempting to ensure that hashed values from a ByteString input would always be distinguishable from hashed values of, say, a Text input. But that's conceptual overhead for users.\r\n\r\nI think, also, there might be a performant solution that allows serialization-for-hashing packages to depend on hash-function packages, instead of the reverse - namely, lazy ByteStrings. They're designed to have minimal time overhead in this sort of scenario which involves concatenating many small pieces. In an ideal world where everyone has infinite time to spend on such efforts, I'd love to see an empirical comparison of the two approaches."}}