{"action":"opened","number":13,"pull_request":{"url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/13","id":99667167,"html_url":"https://github.com/ThomasMeijers/scala-oriented/pull/13","diff_url":"https://github.com/ThomasMeijers/scala-oriented/pull/13.diff","patch_url":"https://github.com/ThomasMeijers/scala-oriented/pull/13.patch","issue_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/issues/13","number":13,"state":"open","locked":false,"title":"WIP: Map based derived formats","user":{"login":"Fristi","id":141265,"avatar_url":"https://avatars.githubusercontent.com/u/141265?v=3","gravatar_id":"","url":"https://api.github.com/users/Fristi","html_url":"https://github.com/Fristi","followers_url":"https://api.github.com/users/Fristi/followers","following_url":"https://api.github.com/users/Fristi/following{/other_user}","gists_url":"https://api.github.com/users/Fristi/gists{/gist_id}","starred_url":"https://api.github.com/users/Fristi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fristi/subscriptions","organizations_url":"https://api.github.com/users/Fristi/orgs","repos_url":"https://api.github.com/users/Fristi/repos","events_url":"https://api.github.com/users/Fristi/events{/privacy}","received_events_url":"https://api.github.com/users/Fristi/received_events","type":"User","site_admin":false},"body":"Map based derived formats. This is a continuation of the work done here: https://github.com/nevillelyh/shapeless-datatype/pull/1\r\n\r\nWe are using the `ReadDSL` quite heavily in the current project. Refactoring everything without having tests wouldn't be a good idea. Also with the time constraints in the project I would suggest to deprecate this `ReadDSL`, by gradually removing the formats when you work on part of the project. By doing that you can immediately test if this would work.\r\n\r\nMigration ? Good luck on existing data, well you are screwed when there a nested documents I think. Because embedded objects are stored in some Base64 encoded string from what I saw.\r\n\r\nLimitations of this approach? Well the codecs partial, so not total. Normally you would define a encoder, decoder or codec for specific type. We also do that, but there are some constrains here, that if you read some it has to be bound by a \"key\". A good example of this \"partial\" stuff is methods like `mapTraversableOnceMappable`. It is a type class instance with which is only resolved if these implicits are there: \r\n\r\n```scala\r\nimplicit def mapTraversableOnceMappable[K <: Symbol, H, T <: HList, M, C[_]](implicit\r\n                                                          BMT: BaseMappableType[M],\r\n                                                          K: Witness.Aux[K],\r\n                                                          H: MappableType[M, H],\r\n                                                          T: FromMappable[T, M],\r\n                                                          CBF: CanBuildFrom[_, H, C[H]]): FromMappable[FieldType[K, Map[String, C[H]]] :: T, M] = ???\r\n```\r\n\r\nThere are some heavy constraints at work here. We summon a `FromMappable[FieldType[K, Map[String, C[H]]] :: T, M]`.\r\n\r\nSo let me break this down:\r\n\r\n- `M` is a `Map[String, Any]`\r\n- `K` is the `Symbol` associated with the name of the case class member\r\n- `C[_]` is a collection type\r\n- `H` is the head of the HList, a single element\r\n- `T` is the the tail of the HList\r\n\r\n`H: MappableType[M, H]` is a type class which is summoned which can retrieve a `H` from a `M`. \r\n`T: FromMappable[T, M]` is a type class which is summoned which can dedode the tail of this HList or product type.\r\n\r\nAs you can see: This is only a part of a total type \"system\". Therefore on some cases derivation might not work. In most day to day work, it should work fine. If would remove `mapTraversableOnceMappable` a case class like this wouldn't work:\r\n\r\n```scala\r\ncase class Foo(map: Map[String, List[Int]])\r\n```\r\n\r\n\r\nTODO\r\n- [ ] Now you have to bring `oriented.maps.scalaMap._` into scope to make it work, shouldn't be like that\r\n- [ ] Doesn't work with `Map[Day, String]` while there is a invariant mapping from `Day => String`","created_at":"2016-12-29T15:25:29Z","updated_at":"2016-12-29T15:25:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/13/commits","review_comments_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/13/comments","review_comment_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/issues/13/comments","statuses_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/statuses/2ee6a54ee8357da85680a16801e44b5c8ffc4390","head":{"label":"vectos:feature/formats","ref":"feature/formats","sha":"2ee6a54ee8357da85680a16801e44b5c8ffc4390","user":{"login":"vectos","id":19636118,"avatar_url":"https://avatars.githubusercontent.com/u/19636118?v=3","gravatar_id":"","url":"https://api.github.com/users/vectos","html_url":"https://github.com/vectos","followers_url":"https://api.github.com/users/vectos/followers","following_url":"https://api.github.com/users/vectos/following{/other_user}","gists_url":"https://api.github.com/users/vectos/gists{/gist_id}","starred_url":"https://api.github.com/users/vectos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vectos/subscriptions","organizations_url":"https://api.github.com/users/vectos/orgs","repos_url":"https://api.github.com/users/vectos/repos","events_url":"https://api.github.com/users/vectos/events{/privacy}","received_events_url":"https://api.github.com/users/vectos/received_events","type":"Organization","site_admin":false},"repo":{"id":75186237,"name":"scala-oriented","full_name":"vectos/scala-oriented","owner":{"login":"vectos","id":19636118,"avatar_url":"https://avatars.githubusercontent.com/u/19636118?v=3","gravatar_id":"","url":"https://api.github.com/users/vectos","html_url":"https://github.com/vectos","followers_url":"https://api.github.com/users/vectos/followers","following_url":"https://api.github.com/users/vectos/following{/other_user}","gists_url":"https://api.github.com/users/vectos/gists{/gist_id}","starred_url":"https://api.github.com/users/vectos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vectos/subscriptions","organizations_url":"https://api.github.com/users/vectos/orgs","repos_url":"https://api.github.com/users/vectos/repos","events_url":"https://api.github.com/users/vectos/events{/privacy}","received_events_url":"https://api.github.com/users/vectos/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vectos/scala-oriented","description":"Scala wrapper for the OrientDB Java API, oriented on functional and typeful programming.","fork":true,"url":"https://api.github.com/repos/vectos/scala-oriented","forks_url":"https://api.github.com/repos/vectos/scala-oriented/forks","keys_url":"https://api.github.com/repos/vectos/scala-oriented/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vectos/scala-oriented/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vectos/scala-oriented/teams","hooks_url":"https://api.github.com/repos/vectos/scala-oriented/hooks","issue_events_url":"https://api.github.com/repos/vectos/scala-oriented/issues/events{/number}","events_url":"https://api.github.com/repos/vectos/scala-oriented/events","assignees_url":"https://api.github.com/repos/vectos/scala-oriented/assignees{/user}","branches_url":"https://api.github.com/repos/vectos/scala-oriented/branches{/branch}","tags_url":"https://api.github.com/repos/vectos/scala-oriented/tags","blobs_url":"https://api.github.com/repos/vectos/scala-oriented/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vectos/scala-oriented/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vectos/scala-oriented/git/refs{/sha}","trees_url":"https://api.github.com/repos/vectos/scala-oriented/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vectos/scala-oriented/statuses/{sha}","languages_url":"https://api.github.com/repos/vectos/scala-oriented/languages","stargazers_url":"https://api.github.com/repos/vectos/scala-oriented/stargazers","contributors_url":"https://api.github.com/repos/vectos/scala-oriented/contributors","subscribers_url":"https://api.github.com/repos/vectos/scala-oriented/subscribers","subscription_url":"https://api.github.com/repos/vectos/scala-oriented/subscription","commits_url":"https://api.github.com/repos/vectos/scala-oriented/commits{/sha}","git_commits_url":"https://api.github.com/repos/vectos/scala-oriented/git/commits{/sha}","comments_url":"https://api.github.com/repos/vectos/scala-oriented/comments{/number}","issue_comment_url":"https://api.github.com/repos/vectos/scala-oriented/issues/comments{/number}","contents_url":"https://api.github.com/repos/vectos/scala-oriented/contents/{+path}","compare_url":"https://api.github.com/repos/vectos/scala-oriented/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vectos/scala-oriented/merges","archive_url":"https://api.github.com/repos/vectos/scala-oriented/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vectos/scala-oriented/downloads","issues_url":"https://api.github.com/repos/vectos/scala-oriented/issues{/number}","pulls_url":"https://api.github.com/repos/vectos/scala-oriented/pulls{/number}","milestones_url":"https://api.github.com/repos/vectos/scala-oriented/milestones{/number}","notifications_url":"https://api.github.com/repos/vectos/scala-oriented/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vectos/scala-oriented/labels{/name}","releases_url":"https://api.github.com/repos/vectos/scala-oriented/releases{/id}","deployments_url":"https://api.github.com/repos/vectos/scala-oriented/deployments","created_at":"2016-11-30T12:46:58Z","updated_at":"2016-11-30T12:46:59Z","pushed_at":"2016-12-29T14:42:57Z","git_url":"git://github.com/vectos/scala-oriented.git","ssh_url":"git@github.com:vectos/scala-oriented.git","clone_url":"https://github.com/vectos/scala-oriented.git","svn_url":"https://github.com/vectos/scala-oriented","homepage":null,"size":75,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ThomasMeijers:master","ref":"master","sha":"7bf2bbe37dea058de2710732fcd978fe2aea00ae","user":{"login":"ThomasMeijers","id":4912941,"avatar_url":"https://avatars.githubusercontent.com/u/4912941?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasMeijers","html_url":"https://github.com/ThomasMeijers","followers_url":"https://api.github.com/users/ThomasMeijers/followers","following_url":"https://api.github.com/users/ThomasMeijers/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMeijers/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMeijers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMeijers/subscriptions","organizations_url":"https://api.github.com/users/ThomasMeijers/orgs","repos_url":"https://api.github.com/users/ThomasMeijers/repos","events_url":"https://api.github.com/users/ThomasMeijers/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMeijers/received_events","type":"User","site_admin":false},"repo":{"id":69461220,"name":"scala-oriented","full_name":"ThomasMeijers/scala-oriented","owner":{"login":"ThomasMeijers","id":4912941,"avatar_url":"https://avatars.githubusercontent.com/u/4912941?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasMeijers","html_url":"https://github.com/ThomasMeijers","followers_url":"https://api.github.com/users/ThomasMeijers/followers","following_url":"https://api.github.com/users/ThomasMeijers/following{/other_user}","gists_url":"https://api.github.com/users/ThomasMeijers/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasMeijers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasMeijers/subscriptions","organizations_url":"https://api.github.com/users/ThomasMeijers/orgs","repos_url":"https://api.github.com/users/ThomasMeijers/repos","events_url":"https://api.github.com/users/ThomasMeijers/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasMeijers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ThomasMeijers/scala-oriented","description":"Scala wrapper for the OrientDB Java API, oriented on functional and typeful programming.","fork":false,"url":"https://api.github.com/repos/ThomasMeijers/scala-oriented","forks_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/forks","keys_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/teams","hooks_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/hooks","issue_events_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/issues/events{/number}","events_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/events","assignees_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/assignees{/user}","branches_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/branches{/branch}","tags_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/tags","blobs_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/git/refs{/sha}","trees_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/statuses/{sha}","languages_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/languages","stargazers_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/stargazers","contributors_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/contributors","subscribers_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/subscribers","subscription_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/subscription","commits_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/commits{/sha}","git_commits_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/git/commits{/sha}","comments_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/comments{/number}","issue_comment_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/issues/comments{/number}","contents_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/contents/{+path}","compare_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/merges","archive_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/downloads","issues_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/issues{/number}","pulls_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls{/number}","milestones_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/milestones{/number}","notifications_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/labels{/name}","releases_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/releases{/id}","deployments_url":"https://api.github.com/repos/ThomasMeijers/scala-oriented/deployments","created_at":"2016-09-28T12:32:56Z","updated_at":"2016-12-21T19:39:57Z","pushed_at":"2016-12-21T20:51:55Z","git_url":"git://github.com/ThomasMeijers/scala-oriented.git","ssh_url":"git@github.com:ThomasMeijers/scala-oriented.git","clone_url":"https://github.com/ThomasMeijers/scala-oriented.git","svn_url":"https://github.com/ThomasMeijers/scala-oriented","homepage":null,"size":63,"stargazers_count":4,"watchers_count":4,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":5,"forks":3,"open_issues":5,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/13"},"html":{"href":"https://github.com/ThomasMeijers/scala-oriented/pull/13"},"issue":{"href":"https://api.github.com/repos/ThomasMeijers/scala-oriented/issues/13"},"comments":{"href":"https://api.github.com/repos/ThomasMeijers/scala-oriented/issues/13/comments"},"review_comments":{"href":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/13/comments"},"review_comment":{"href":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ThomasMeijers/scala-oriented/pulls/13/commits"},"statuses":{"href":"https://api.github.com/repos/ThomasMeijers/scala-oriented/statuses/2ee6a54ee8357da85680a16801e44b5c8ffc4390"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":10,"additions":728,"deletions":56,"changed_files":41}}
{"actor":{"display_login":"Fristi"}}