{"action":"created","comment":{"url":"https://api.github.com/repos/ambiata/ivory/pulls/comments/24134929","id":24134929,"diff_hunk":"@@ -12,39 +34,53 @@ case object DoubleEncoding    extends PrimitiveEncoding\n case object StringEncoding    extends PrimitiveEncoding\n case object DateEncoding      extends PrimitiveEncoding\n \n-sealed trait SubEncoding extends Encoding\n+sealed trait SubEncoding {\n \n-case class StructEncoding(values: Map[String, StructEncodedValue]) extends SubEncoding\n-case class ListEncoding(encoding: SubEncoding) extends Encoding\n+  def toEncoding: Encoding =\n+    EncodingSub(this)\n+}\n+case class SubPrim(e: PrimitiveEncoding) extends SubEncoding\n+case class SubStruct(e: StructEncoding) extends SubEncoding\n+\n+case class StructEncoding(values: Map[String, StructEncodedValue[PrimitiveEncoding]]) {\n+\n+  def toEncoding: Encoding =\n+    SubStruct(this).toEncoding\n+}\n+case class ListEncoding(encoding: SubEncoding) {\n+\n+  def toEncoding: Encoding =\n+    EncodingList(this)\n+}\n \n // NOTE: For now we don't support nested structs\n-case class StructEncodedValue(encoding: PrimitiveEncoding, optional: Boolean = false) {\n-  def opt: StructEncodedValue =\n+case class StructEncodedValue[A](encoding: A, optional: Boolean = false) {","path":"ivory-core/src/main/scala/com/ambiata/ivory/core/Encoding.scala","position":65,"original_position":65,"commit_id":"e735ef933fc19bda27d58d430f918ec55831fc60","original_commit_id":"e735ef933fc19bda27d58d430f918ec55831fc60","user":{"login":"markhibberd","id":22832,"avatar_url":"https://avatars.githubusercontent.com/u/22832?v=3","gravatar_id":"","url":"https://api.github.com/users/markhibberd","html_url":"https://github.com/markhibberd","followers_url":"https://api.github.com/users/markhibberd/followers","following_url":"https://api.github.com/users/markhibberd/following{/other_user}","gists_url":"https://api.github.com/users/markhibberd/gists{/gist_id}","starred_url":"https://api.github.com/users/markhibberd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markhibberd/subscriptions","organizations_url":"https://api.github.com/users/markhibberd/orgs","repos_url":"https://api.github.com/users/markhibberd/repos","events_url":"https://api.github.com/users/markhibberd/events{/privacy}","received_events_url":"https://api.github.com/users/markhibberd/received_events","type":"User","site_admin":false},"body":"Snip the default param while you are there.","created_at":"2015-02-05T00:49:18Z","updated_at":"2015-02-05T00:49:18Z","html_url":"https://github.com/ambiata/ivory/pull/594#discussion_r24134929","pull_request_url":"https://api.github.com/repos/ambiata/ivory/pulls/594","_links":{"self":{"href":"https://api.github.com/repos/ambiata/ivory/pulls/comments/24134929"},"html":{"href":"https://github.com/ambiata/ivory/pull/594#discussion_r24134929"},"pull_request":{"href":"https://api.github.com/repos/ambiata/ivory/pulls/594"}}},"pull_request":{"url":"https://api.github.com/repos/ambiata/ivory/pulls/594","id":28688623,"html_url":"https://github.com/ambiata/ivory/pull/594","diff_url":"https://github.com/ambiata/ivory/pull/594.diff","patch_url":"https://github.com/ambiata/ivory/pull/594.patch","issue_url":"https://api.github.com/repos/ambiata/ivory/issues/594","number":594,"state":"open","locked":false,"title":"Property express Encoding types without inheritance","user":{"login":"charleso","id":31059,"avatar_url":"https://avatars.githubusercontent.com/u/31059?v=3","gravatar_id":"","url":"https://api.github.com/users/charleso","html_url":"https://github.com/charleso","followers_url":"https://api.github.com/users/charleso/followers","following_url":"https://api.github.com/users/charleso/following{/other_user}","gists_url":"https://api.github.com/users/charleso/gists{/gist_id}","starred_url":"https://api.github.com/users/charleso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/charleso/subscriptions","organizations_url":"https://api.github.com/users/charleso/orgs","repos_url":"https://api.github.com/users/charleso/repos","events_url":"https://api.github.com/users/charleso/events{/privacy}","received_events_url":"https://api.github.com/users/charleso/received_events","type":"User","site_admin":false},"body":"Complain and ye shall receive.\r\n\r\nThe names of the new types are kinda sucky. Happy to rename if people have suggestions.\r\n\r\nNot sure about the last two commits and the change to `StructEncodedValue` - but that made it possible to add `foldRec`.\r\n\r\nDepending on how this is received I'm happy to do `Value` next.","created_at":"2015-02-05T00:19:29Z","updated_at":"2015-02-05T00:49:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b1b217a8a8918c30e068ae9f12a3164c6c829be1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ambiata/ivory/pulls/594/commits","review_comments_url":"https://api.github.com/repos/ambiata/ivory/pulls/594/comments","review_comment_url":"https://api.github.com/repos/ambiata/ivory/pulls/comments/{number}","comments_url":"https://api.github.com/repos/ambiata/ivory/issues/594/comments","statuses_url":"https://api.github.com/repos/ambiata/ivory/statuses/e735ef933fc19bda27d58d430f918ec55831fc60","head":{"label":"ambiata:topic/value-encoding-types","ref":"topic/value-encoding-types","sha":"e735ef933fc19bda27d58d430f918ec55831fc60","user":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"repo":{"id":18756054,"name":"ivory","full_name":"ambiata/ivory","owner":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ambiata/ivory","description":"A scalable and extensible data store for storing facts and extracting features.","fork":false,"url":"https://api.github.com/repos/ambiata/ivory","forks_url":"https://api.github.com/repos/ambiata/ivory/forks","keys_url":"https://api.github.com/repos/ambiata/ivory/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ambiata/ivory/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ambiata/ivory/teams","hooks_url":"https://api.github.com/repos/ambiata/ivory/hooks","issue_events_url":"https://api.github.com/repos/ambiata/ivory/issues/events{/number}","events_url":"https://api.github.com/repos/ambiata/ivory/events","assignees_url":"https://api.github.com/repos/ambiata/ivory/assignees{/user}","branches_url":"https://api.github.com/repos/ambiata/ivory/branches{/branch}","tags_url":"https://api.github.com/repos/ambiata/ivory/tags","blobs_url":"https://api.github.com/repos/ambiata/ivory/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ambiata/ivory/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ambiata/ivory/git/refs{/sha}","trees_url":"https://api.github.com/repos/ambiata/ivory/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ambiata/ivory/statuses/{sha}","languages_url":"https://api.github.com/repos/ambiata/ivory/languages","stargazers_url":"https://api.github.com/repos/ambiata/ivory/stargazers","contributors_url":"https://api.github.com/repos/ambiata/ivory/contributors","subscribers_url":"https://api.github.com/repos/ambiata/ivory/subscribers","subscription_url":"https://api.github.com/repos/ambiata/ivory/subscription","commits_url":"https://api.github.com/repos/ambiata/ivory/commits{/sha}","git_commits_url":"https://api.github.com/repos/ambiata/ivory/git/commits{/sha}","comments_url":"https://api.github.com/repos/ambiata/ivory/comments{/number}","issue_comment_url":"https://api.github.com/repos/ambiata/ivory/issues/comments/{number}","contents_url":"https://api.github.com/repos/ambiata/ivory/contents/{+path}","compare_url":"https://api.github.com/repos/ambiata/ivory/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ambiata/ivory/merges","archive_url":"https://api.github.com/repos/ambiata/ivory/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ambiata/ivory/downloads","issues_url":"https://api.github.com/repos/ambiata/ivory/issues{/number}","pulls_url":"https://api.github.com/repos/ambiata/ivory/pulls{/number}","milestones_url":"https://api.github.com/repos/ambiata/ivory/milestones{/number}","notifications_url":"https://api.github.com/repos/ambiata/ivory/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ambiata/ivory/labels{/name}","releases_url":"https://api.github.com/repos/ambiata/ivory/releases{/id}","created_at":"2014-04-14T09:54:53Z","updated_at":"2015-02-04T23:07:26Z","pushed_at":"2015-02-05T00:31:59Z","git_url":"git://github.com/ambiata/ivory.git","ssh_url":"git@github.com:ambiata/ivory.git","clone_url":"https://github.com/ambiata/ivory.git","svn_url":"https://github.com/ambiata/ivory","homepage":"","size":13264,"stargazers_count":31,"watchers_count":31,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":121,"forks":4,"open_issues":121,"watchers":31,"default_branch":"master"}},"base":{"label":"ambiata:master","ref":"master","sha":"11664ad712596ed453889a90bd897a9064f80b57","user":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"repo":{"id":18756054,"name":"ivory","full_name":"ambiata/ivory","owner":{"login":"ambiata","id":1691023,"avatar_url":"https://avatars.githubusercontent.com/u/1691023?v=3","gravatar_id":"","url":"https://api.github.com/users/ambiata","html_url":"https://github.com/ambiata","followers_url":"https://api.github.com/users/ambiata/followers","following_url":"https://api.github.com/users/ambiata/following{/other_user}","gists_url":"https://api.github.com/users/ambiata/gists{/gist_id}","starred_url":"https://api.github.com/users/ambiata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ambiata/subscriptions","organizations_url":"https://api.github.com/users/ambiata/orgs","repos_url":"https://api.github.com/users/ambiata/repos","events_url":"https://api.github.com/users/ambiata/events{/privacy}","received_events_url":"https://api.github.com/users/ambiata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ambiata/ivory","description":"A scalable and extensible data store for storing facts and extracting features.","fork":false,"url":"https://api.github.com/repos/ambiata/ivory","forks_url":"https://api.github.com/repos/ambiata/ivory/forks","keys_url":"https://api.github.com/repos/ambiata/ivory/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ambiata/ivory/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ambiata/ivory/teams","hooks_url":"https://api.github.com/repos/ambiata/ivory/hooks","issue_events_url":"https://api.github.com/repos/ambiata/ivory/issues/events{/number}","events_url":"https://api.github.com/repos/ambiata/ivory/events","assignees_url":"https://api.github.com/repos/ambiata/ivory/assignees{/user}","branches_url":"https://api.github.com/repos/ambiata/ivory/branches{/branch}","tags_url":"https://api.github.com/repos/ambiata/ivory/tags","blobs_url":"https://api.github.com/repos/ambiata/ivory/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ambiata/ivory/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ambiata/ivory/git/refs{/sha}","trees_url":"https://api.github.com/repos/ambiata/ivory/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ambiata/ivory/statuses/{sha}","languages_url":"https://api.github.com/repos/ambiata/ivory/languages","stargazers_url":"https://api.github.com/repos/ambiata/ivory/stargazers","contributors_url":"https://api.github.com/repos/ambiata/ivory/contributors","subscribers_url":"https://api.github.com/repos/ambiata/ivory/subscribers","subscription_url":"https://api.github.com/repos/ambiata/ivory/subscription","commits_url":"https://api.github.com/repos/ambiata/ivory/commits{/sha}","git_commits_url":"https://api.github.com/repos/ambiata/ivory/git/commits{/sha}","comments_url":"https://api.github.com/repos/ambiata/ivory/comments{/number}","issue_comment_url":"https://api.github.com/repos/ambiata/ivory/issues/comments/{number}","contents_url":"https://api.github.com/repos/ambiata/ivory/contents/{+path}","compare_url":"https://api.github.com/repos/ambiata/ivory/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ambiata/ivory/merges","archive_url":"https://api.github.com/repos/ambiata/ivory/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ambiata/ivory/downloads","issues_url":"https://api.github.com/repos/ambiata/ivory/issues{/number}","pulls_url":"https://api.github.com/repos/ambiata/ivory/pulls{/number}","milestones_url":"https://api.github.com/repos/ambiata/ivory/milestones{/number}","notifications_url":"https://api.github.com/repos/ambiata/ivory/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ambiata/ivory/labels{/name}","releases_url":"https://api.github.com/repos/ambiata/ivory/releases{/id}","created_at":"2014-04-14T09:54:53Z","updated_at":"2015-02-04T23:07:26Z","pushed_at":"2015-02-05T00:31:59Z","git_url":"git://github.com/ambiata/ivory.git","ssh_url":"git@github.com:ambiata/ivory.git","clone_url":"https://github.com/ambiata/ivory.git","svn_url":"https://github.com/ambiata/ivory","homepage":"","size":13264,"stargazers_count":31,"watchers_count":31,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":121,"forks":4,"open_issues":121,"watchers":31,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ambiata/ivory/pulls/594"},"html":{"href":"https://github.com/ambiata/ivory/pull/594"},"issue":{"href":"https://api.github.com/repos/ambiata/ivory/issues/594"},"comments":{"href":"https://api.github.com/repos/ambiata/ivory/issues/594/comments"},"review_comments":{"href":"https://api.github.com/repos/ambiata/ivory/pulls/594/comments"},"review_comment":{"href":"https://api.github.com/repos/ambiata/ivory/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/ambiata/ivory/pulls/594/commits"},"statuses":{"href":"https://api.github.com/repos/ambiata/ivory/statuses/e735ef933fc19bda27d58d430f918ec55831fc60"}}}}