{"action":"created","issue":{"url":"https://api.github.com/repos/alexarchambault/argonaut-shapeless/issues/1","labels_url":"https://api.github.com/repos/alexarchambault/argonaut-shapeless/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/alexarchambault/argonaut-shapeless/issues/1/comments","events_url":"https://api.github.com/repos/alexarchambault/argonaut-shapeless/issues/1/events","html_url":"https://github.com/alexarchambault/argonaut-shapeless/pull/1","id":53535582,"number":1,"title":"Support explicit codec materialization.","user":{"login":"tixxit","id":120314,"avatar_url":"https://avatars.githubusercontent.com/u/120314?v=3","gravatar_id":"","url":"https://api.github.com/users/tixxit","html_url":"https://github.com/tixxit","followers_url":"https://api.github.com/users/tixxit/followers","following_url":"https://api.github.com/users/tixxit/following{/other_user}","gists_url":"https://api.github.com/users/tixxit/gists{/gist_id}","starred_url":"https://api.github.com/users/tixxit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tixxit/subscriptions","organizations_url":"https://api.github.com/users/tixxit/orgs","repos_url":"https://api.github.com/users/tixxit/repos","events_url":"https://api.github.com/users/tixxit/events{/privacy}","received_events_url":"https://api.github.com/users/tixxit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-06T16:54:43Z","updated_at":"2015-01-06T22:06:46Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/alexarchambault/argonaut-shapeless/pulls/1","html_url":"https://github.com/alexarchambault/argonaut-shapeless/pull/1","diff_url":"https://github.com/alexarchambault/argonaut-shapeless/pull/1.diff","patch_url":"https://github.com/alexarchambault/argonaut-shapeless/pull/1.patch"},"body":"Rather than having derivation to be implicit, this allows the user to choose to continue importing the Shapeless._ object for implicits, or use, eg, `AutoEncodeJson.derive[Foo]` to be more explicit.\r\n\r\nFor example, I would likely do something like:\r\n\r\n```scala\r\ncase class Foo(x: Int)\r\n\r\n...\r\n\r\nimplicit val FooCodecJson: CodecJson[Foo] = AutoCodecJson.derive[Foo]\r\n```\r\n\r\nI had to remove the `Lazy` wrappers, otherwise the implicit resolution failed. I'm not sure why this is. `-Xlog-implicits` said the error was that `mkLazy` was returning a `Lazy[Nothing]` rather than a `Lazy[EncodeJson[Int]]` where required. So the type was lost somehow and it was failing."},"comment":{"url":"https://api.github.com/repos/alexarchambault/argonaut-shapeless/issues/comments/68942890","html_url":"https://github.com/alexarchambault/argonaut-shapeless/pull/1#issuecomment-68942890","issue_url":"https://api.github.com/repos/alexarchambault/argonaut-shapeless/issues/1","id":68942890,"user":{"login":"alexarchambault","id":7063723,"avatar_url":"https://avatars.githubusercontent.com/u/7063723?v=3","gravatar_id":"","url":"https://api.github.com/users/alexarchambault","html_url":"https://github.com/alexarchambault","followers_url":"https://api.github.com/users/alexarchambault/followers","following_url":"https://api.github.com/users/alexarchambault/following{/other_user}","gists_url":"https://api.github.com/users/alexarchambault/gists{/gist_id}","starred_url":"https://api.github.com/users/alexarchambault/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexarchambault/subscriptions","organizations_url":"https://api.github.com/users/alexarchambault/orgs","repos_url":"https://api.github.com/users/alexarchambault/repos","events_url":"https://api.github.com/users/alexarchambault/events{/privacy}","received_events_url":"https://api.github.com/users/alexarchambault/received_events","type":"User","site_admin":false},"created_at":"2015-01-06T22:06:46Z","updated_at":"2015-01-06T22:06:46Z","body":"Thanks, I think it would indeed be a good idea if we could generate auto codec only for a few classes without importing the whole `Shapeless` namespace. But only in addition to the way they are currently used.\r\n\r\nI updated the tests with more complex examples, that `Lazy` was precisely tailored to handle. And as I expected, removing it (tested that with your code) breaks some of them.\r\n\r\nI'll look more closely at your code, and/or try to find a solution to have both ways together."}}