{"action":"created","issue":{"url":"https://api.github.com/repos/circe/circe/issues/811","repository_url":"https://api.github.com/repos/circe/circe","labels_url":"https://api.github.com/repos/circe/circe/issues/811/labels{/name}","comments_url":"https://api.github.com/repos/circe/circe/issues/811/comments","events_url":"https://api.github.com/repos/circe/circe/issues/811/events","html_url":"https://github.com/circe/circe/pull/811","id":284104176,"number":811,"title":"wip: Codec typeclass #133","user":{"login":"lorandszakacs","id":843135,"avatar_url":"https://avatars2.githubusercontent.com/u/843135?v=4","gravatar_id":"","url":"https://api.github.com/users/lorandszakacs","html_url":"https://github.com/lorandszakacs","followers_url":"https://api.github.com/users/lorandszakacs/followers","following_url":"https://api.github.com/users/lorandszakacs/following{/other_user}","gists_url":"https://api.github.com/users/lorandszakacs/gists{/gist_id}","starred_url":"https://api.github.com/users/lorandszakacs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lorandszakacs/subscriptions","organizations_url":"https://api.github.com/users/lorandszakacs/orgs","repos_url":"https://api.github.com/users/lorandszakacs/repos","events_url":"https://api.github.com/users/lorandszakacs/events{/privacy}","received_events_url":"https://api.github.com/users/lorandszakacs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-12-22T08:35:48Z","updated_at":"2018-02-22T16:53:58Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/circe/circe/pulls/811","html_url":"https://github.com/circe/circe/pull/811","diff_url":"https://github.com/circe/circe/pull/811.diff","patch_url":"https://github.com/circe/circe/pull/811.patch"},"body":"Hello folks,\r\n\r\nTrying to address issue #133 \r\n\r\nYou can see it in action in the `io.circe.generic.SemiautoDerivedCodecSuite` test.\r\n\r\nThere's still some work to be done here, but I wanted to get feedback first, because said work heavily depends on it.\r\n\r\nDesign choices:\r\n 1. `Codec` is a trait, rather than a simple type alias\r\n    a. In the first commit of this PR it was a type-alias, but then I had to change it. The full rationale, and the code changes can be seen in commit b0b755e ** of this PR. Basically, without this you cannot satisfy point 1 from @travisbrown's wishlist, namely that a `Codec` instance should be available (without imports) whenever there is an `Encoder` + `Decoder` available.\r\n 2. lol, I really was expecting a longer list, but I guess this is it\r\n\r\nNow, if we go down the route that @tpolecat mentioned in [this comment](https://github.com/circe/circe/issues/133#issuecomment-161133882), then the need for auto-magic `Codec` summoning is not necessary., ergo no need for a special trait, and a type alias will suffice. And I tend to agree with him. I'm fine either way, at the end of the day tough. The only case I think `Codec` is valuable anyway is reducing `semiauto` derivation boilerplate.\r\n\r\nTODO:\r\n- [x] write tests for `generic.extras.semiauto` derivation of `Codec`\r\n- [ ] provide the `Codec` instances @travisbrown mentioned in issue #133 @ number 5 wishlist item, but this is dependent on keeping `Codec` as a trait.\r\n- [ ] address other issues pointed out by the community\r\n\r\n** Full [commit](https://github.com/lorandszakacs/circe/commit/b0b755e4bbcd5c07b33f54981711b437556ae289) message:\r\n```\r\nTransform Codec from type-alias to trait #133\r\n\r\nThis was done to allow the definition of an implicit def that creates\r\na Codec for some type 'A' if we have an Encoder + Decoder for it in scope.\r\n\r\nThis implicit def can't be put anywhere else because then nothing compiles\r\nanymore due to implicit search divergence problems, and the only way to\r\nput it into a \"companion object\" is if it's a top level type.\r\n\r\nThis can be reverted if it is deemed necessary that such an implicit def\r\nis undesirable.\r\n```"},"comment":{"url":"https://api.github.com/repos/circe/circe/issues/comments/367745934","html_url":"https://github.com/circe/circe/pull/811#issuecomment-367745934","issue_url":"https://api.github.com/repos/circe/circe/issues/811","id":367745934,"user":{"login":"travisbrown","id":316049,"avatar_url":"https://avatars3.githubusercontent.com/u/316049?v=4","gravatar_id":"","url":"https://api.github.com/users/travisbrown","html_url":"https://github.com/travisbrown","followers_url":"https://api.github.com/users/travisbrown/followers","following_url":"https://api.github.com/users/travisbrown/following{/other_user}","gists_url":"https://api.github.com/users/travisbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/travisbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisbrown/subscriptions","organizations_url":"https://api.github.com/users/travisbrown/orgs","repos_url":"https://api.github.com/users/travisbrown/repos","events_url":"https://api.github.com/users/travisbrown/events{/privacy}","received_events_url":"https://api.github.com/users/travisbrown/received_events","type":"User","site_admin":false},"created_at":"2018-02-22T16:53:57Z","updated_at":"2018-02-22T16:53:57Z","author_association":"OWNER","body":"Sorry for the long delay on review here—I've been meaning to spend some more time working with this approach but haven't had a chance yet. I'm also interested in feedback from other users."}}
{"actor":{"display_login":"travisbrown"}}