{"action":"created","issue":{"url":"https://api.github.com/repos/ndmitchell/shake/issues/637","repository_url":"https://api.github.com/repos/ndmitchell/shake","labels_url":"https://api.github.com/repos/ndmitchell/shake/issues/637/labels{/name}","comments_url":"https://api.github.com/repos/ndmitchell/shake/issues/637/comments","events_url":"https://api.github.com/repos/ndmitchell/shake/issues/637/events","html_url":"https://github.com/ndmitchell/shake/issues/637","id":392346368,"node_id":"MDU6SXNzdWUzOTIzNDYzNjg=","number":637,"title":"Allow arbitrary transformations after deserialization from shake database","user":{"login":"afranchuk","id":4296804,"node_id":"MDQ6VXNlcjQyOTY4MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4296804?v=4","gravatar_id":"","url":"https://api.github.com/users/afranchuk","html_url":"https://github.com/afranchuk","followers_url":"https://api.github.com/users/afranchuk/followers","following_url":"https://api.github.com/users/afranchuk/following{/other_user}","gists_url":"https://api.github.com/users/afranchuk/gists{/gist_id}","starred_url":"https://api.github.com/users/afranchuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afranchuk/subscriptions","organizations_url":"https://api.github.com/users/afranchuk/orgs","repos_url":"https://api.github.com/users/afranchuk/repos","events_url":"https://api.github.com/users/afranchuk/events{/privacy}","received_events_url":"https://api.github.com/users/afranchuk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-12-18T21:37:56Z","updated_at":"2018-12-21T21:46:13Z","closed_at":null,"author_association":"NONE","body":"I'm using a custom builtin rule through which almost all operations are performed. It's worked well up to this point, but I'm in the midst of a refactor and having a tricky time.\r\n\r\nPreviously, the data which was used as a key for the custom rule had a type field, which was a normal sum type (and rather extensive). I wanted to make this more modular by breaking up that sum type to be separate types defined in separate modules. This immediately causes problems because the binary deserialization needs to know the type it's deserializing. I had been using static pointers previously to solve this (as the key type also contains arbitrary data unrelated to type), and I know that works (P.S. thanks for your post on just that problem). However, I wanted to move away from the static pointers and instead try to use a registry of types indexed by UUID, and serialized with that ID. The trouble is that the Binary.get implementation must be pure, so there's no opportunity for my code to post-process the loaded data to properly lookup by uuid and deserialize the \"untyped\" data.\r\n\r\nI have been trying to work around this, and thought I had a solution that would work, but something is amiss and the deserialization is failing in a non-obvious way.\r\n\r\nThe shake database does not allow users to insert some operation between deserialization and hashing/equality checking. If there was a way to set such an operation, it would solve my problem. I'm thinking it would be most appropriate to specify such an operation with `addBuiltinRule`. Otherwise, I might just go back to using static pointers, because that did at least work before."},"comment":{"url":"https://api.github.com/repos/ndmitchell/shake/issues/comments/449506180","html_url":"https://github.com/ndmitchell/shake/issues/637#issuecomment-449506180","issue_url":"https://api.github.com/repos/ndmitchell/shake/issues/637","id":449506180,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTUwNjE4MA==","user":{"login":"afranchuk","id":4296804,"node_id":"MDQ6VXNlcjQyOTY4MDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/4296804?v=4","gravatar_id":"","url":"https://api.github.com/users/afranchuk","html_url":"https://github.com/afranchuk","followers_url":"https://api.github.com/users/afranchuk/followers","following_url":"https://api.github.com/users/afranchuk/following{/other_user}","gists_url":"https://api.github.com/users/afranchuk/gists{/gist_id}","starred_url":"https://api.github.com/users/afranchuk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afranchuk/subscriptions","organizations_url":"https://api.github.com/users/afranchuk/orgs","repos_url":"https://api.github.com/users/afranchuk/repos","events_url":"https://api.github.com/users/afranchuk/events{/privacy}","received_events_url":"https://api.github.com/users/afranchuk/received_events","type":"User","site_admin":false},"created_at":"2018-12-21T21:46:13Z","updated_at":"2018-12-21T21:46:13Z","author_association":"NONE","body":"Ah I see, makes sense."}}
{"actor":{"display_login":"afranchuk"}}