{"action":"created","comment":{"url":"https://api.github.com/repos/zenangst/Tailor/pulls/comments/60897107","id":60897107,"diff_hunk":"@@ -32,3 +33,7 @@ public func <+ <T>(inout left: [T], right: T?) {\n   guard let right = right else { return }\n   left.append(right)\n }\n+\n+public prefix func <? <T: DefaultType>(value: T?) -> T {\n+  return value ?? T.defaultValue\n+}","path":"Sources/Shared/Operators/Operators.swift","position":15,"original_position":15,"commit_id":"105f95e27bcdbb85ba36c9b03524b55900320756","original_commit_id":"105f95e27bcdbb85ba36c9b03524b55900320756","user":{"login":"zenangst","id":57446,"avatar_url":"https://avatars.githubusercontent.com/u/57446?v=3","gravatar_id":"","url":"https://api.github.com/users/zenangst","html_url":"https://github.com/zenangst","followers_url":"https://api.github.com/users/zenangst/followers","following_url":"https://api.github.com/users/zenangst/following{/other_user}","gists_url":"https://api.github.com/users/zenangst/gists{/gist_id}","starred_url":"https://api.github.com/users/zenangst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenangst/subscriptions","organizations_url":"https://api.github.com/users/zenangst/orgs","repos_url":"https://api.github.com/users/zenangst/repos","events_url":"https://api.github.com/users/zenangst/events{/privacy}","received_events_url":"https://api.github.com/users/zenangst/received_events","type":"User","site_admin":false},"body":"Oh right, the left hand side needs a value. This is true, good point!","created_at":"2016-04-25T11:12:46Z","updated_at":"2016-04-25T11:12:46Z","html_url":"https://github.com/zenangst/Tailor/pull/42#discussion_r60897107","pull_request_url":"https://api.github.com/repos/zenangst/Tailor/pulls/42","_links":{"self":{"href":"https://api.github.com/repos/zenangst/Tailor/pulls/comments/60897107"},"html":{"href":"https://github.com/zenangst/Tailor/pull/42#discussion_r60897107"},"pull_request":{"href":"https://api.github.com/repos/zenangst/Tailor/pulls/42"}}},"pull_request":{"url":"https://api.github.com/repos/zenangst/Tailor/pulls/42","id":67700101,"html_url":"https://github.com/zenangst/Tailor/pull/42","diff_url":"https://github.com/zenangst/Tailor/pull/42.diff","patch_url":"https://github.com/zenangst/Tailor/pull/42.patch","issue_url":"https://api.github.com/repos/zenangst/Tailor/issues/42","number":42,"state":"open","locked":false,"title":"Support defaultValue","user":{"login":"onmyway133","id":2284279,"avatar_url":"https://avatars.githubusercontent.com/u/2284279?v=3","gravatar_id":"","url":"https://api.github.com/users/onmyway133","html_url":"https://github.com/onmyway133","followers_url":"https://api.github.com/users/onmyway133/followers","following_url":"https://api.github.com/users/onmyway133/following{/other_user}","gists_url":"https://api.github.com/users/onmyway133/gists{/gist_id}","starred_url":"https://api.github.com/users/onmyway133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onmyway133/subscriptions","organizations_url":"https://api.github.com/users/onmyway133/orgs","repos_url":"https://api.github.com/users/onmyway133/repos","events_url":"https://api.github.com/users/onmyway133/events{/privacy}","received_events_url":"https://api.github.com/users/onmyway133/received_events","type":"User","site_admin":false},"body":"There are cases that users just want `struct` with `let` declaration. Previously, we have to declare `var` for `<-` to work. This just uses simple assignment with default value\r\n\r\n- Add DefaultType for type that has default value\r\n- Add `<?` operator to fall back to default value\r\n\r\n```swift\r\nstruct Book: Mappable {\r\n  let name: String\r\n  let pageCount: Int\r\n  let website: NSURL?\r\n\r\n  init(_ map: JSONDictionary) {\r\n    name = <?map.property(\"name\")\r\n    pageCount = <?map.property(\"page_count\")\r\n    website = map.transform(\"website_url\", transformer: NSURL.init(string: ))\r\n  }\r\n}\r\n```","created_at":"2016-04-25T10:54:53Z","updated_at":"2016-04-25T11:12:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4164078e627bb5fafd88a3bfe4cb5e5a5498426e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/zenangst/Tailor/pulls/42/commits","review_comments_url":"https://api.github.com/repos/zenangst/Tailor/pulls/42/comments","review_comment_url":"https://api.github.com/repos/zenangst/Tailor/pulls/comments{/number}","comments_url":"https://api.github.com/repos/zenangst/Tailor/issues/42/comments","statuses_url":"https://api.github.com/repos/zenangst/Tailor/statuses/105f95e27bcdbb85ba36c9b03524b55900320756","head":{"label":"onmyway133:feature/assignment","ref":"feature/assignment","sha":"105f95e27bcdbb85ba36c9b03524b55900320756","user":{"login":"onmyway133","id":2284279,"avatar_url":"https://avatars.githubusercontent.com/u/2284279?v=3","gravatar_id":"","url":"https://api.github.com/users/onmyway133","html_url":"https://github.com/onmyway133","followers_url":"https://api.github.com/users/onmyway133/followers","following_url":"https://api.github.com/users/onmyway133/following{/other_user}","gists_url":"https://api.github.com/users/onmyway133/gists{/gist_id}","starred_url":"https://api.github.com/users/onmyway133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onmyway133/subscriptions","organizations_url":"https://api.github.com/users/onmyway133/orgs","repos_url":"https://api.github.com/users/onmyway133/repos","events_url":"https://api.github.com/users/onmyway133/events{/privacy}","received_events_url":"https://api.github.com/users/onmyway133/received_events","type":"User","site_admin":false},"repo":{"id":55137383,"name":"Tailor","full_name":"onmyway133/Tailor","owner":{"login":"onmyway133","id":2284279,"avatar_url":"https://avatars.githubusercontent.com/u/2284279?v=3","gravatar_id":"","url":"https://api.github.com/users/onmyway133","html_url":"https://github.com/onmyway133","followers_url":"https://api.github.com/users/onmyway133/followers","following_url":"https://api.github.com/users/onmyway133/following{/other_user}","gists_url":"https://api.github.com/users/onmyway133/gists{/gist_id}","starred_url":"https://api.github.com/users/onmyway133/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/onmyway133/subscriptions","organizations_url":"https://api.github.com/users/onmyway133/orgs","repos_url":"https://api.github.com/users/onmyway133/repos","events_url":"https://api.github.com/users/onmyway133/events{/privacy}","received_events_url":"https://api.github.com/users/onmyway133/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/onmyway133/Tailor","description":"A super fast & convenient object mapper tailored for your needs","fork":true,"url":"https://api.github.com/repos/onmyway133/Tailor","forks_url":"https://api.github.com/repos/onmyway133/Tailor/forks","keys_url":"https://api.github.com/repos/onmyway133/Tailor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/onmyway133/Tailor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/onmyway133/Tailor/teams","hooks_url":"https://api.github.com/repos/onmyway133/Tailor/hooks","issue_events_url":"https://api.github.com/repos/onmyway133/Tailor/issues/events{/number}","events_url":"https://api.github.com/repos/onmyway133/Tailor/events","assignees_url":"https://api.github.com/repos/onmyway133/Tailor/assignees{/user}","branches_url":"https://api.github.com/repos/onmyway133/Tailor/branches{/branch}","tags_url":"https://api.github.com/repos/onmyway133/Tailor/tags","blobs_url":"https://api.github.com/repos/onmyway133/Tailor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/onmyway133/Tailor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/onmyway133/Tailor/git/refs{/sha}","trees_url":"https://api.github.com/repos/onmyway133/Tailor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/onmyway133/Tailor/statuses/{sha}","languages_url":"https://api.github.com/repos/onmyway133/Tailor/languages","stargazers_url":"https://api.github.com/repos/onmyway133/Tailor/stargazers","contributors_url":"https://api.github.com/repos/onmyway133/Tailor/contributors","subscribers_url":"https://api.github.com/repos/onmyway133/Tailor/subscribers","subscription_url":"https://api.github.com/repos/onmyway133/Tailor/subscription","commits_url":"https://api.github.com/repos/onmyway133/Tailor/commits{/sha}","git_commits_url":"https://api.github.com/repos/onmyway133/Tailor/git/commits{/sha}","comments_url":"https://api.github.com/repos/onmyway133/Tailor/comments{/number}","issue_comment_url":"https://api.github.com/repos/onmyway133/Tailor/issues/comments{/number}","contents_url":"https://api.github.com/repos/onmyway133/Tailor/contents/{+path}","compare_url":"https://api.github.com/repos/onmyway133/Tailor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/onmyway133/Tailor/merges","archive_url":"https://api.github.com/repos/onmyway133/Tailor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/onmyway133/Tailor/downloads","issues_url":"https://api.github.com/repos/onmyway133/Tailor/issues{/number}","pulls_url":"https://api.github.com/repos/onmyway133/Tailor/pulls{/number}","milestones_url":"https://api.github.com/repos/onmyway133/Tailor/milestones{/number}","notifications_url":"https://api.github.com/repos/onmyway133/Tailor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/onmyway133/Tailor/labels{/name}","releases_url":"https://api.github.com/repos/onmyway133/Tailor/releases{/id}","deployments_url":"https://api.github.com/repos/onmyway133/Tailor/deployments","created_at":"2016-03-31T09:23:39Z","updated_at":"2016-03-31T09:23:40Z","pushed_at":"2016-04-25T10:53:31Z","git_url":"git://github.com/onmyway133/Tailor.git","ssh_url":"git@github.com:onmyway133/Tailor.git","clone_url":"https://github.com/onmyway133/Tailor.git","svn_url":"https://github.com/onmyway133/Tailor","homepage":"https://github.com/zenangst","size":549,"stargazers_count":0,"watchers_count":0,"language":"Swift","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":"zenangst:master","ref":"master","sha":"a90f28cfe052195c42607333a7d10c81ef6bd0ba","user":{"login":"zenangst","id":57446,"avatar_url":"https://avatars.githubusercontent.com/u/57446?v=3","gravatar_id":"","url":"https://api.github.com/users/zenangst","html_url":"https://github.com/zenangst","followers_url":"https://api.github.com/users/zenangst/followers","following_url":"https://api.github.com/users/zenangst/following{/other_user}","gists_url":"https://api.github.com/users/zenangst/gists{/gist_id}","starred_url":"https://api.github.com/users/zenangst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenangst/subscriptions","organizations_url":"https://api.github.com/users/zenangst/orgs","repos_url":"https://api.github.com/users/zenangst/repos","events_url":"https://api.github.com/users/zenangst/events{/privacy}","received_events_url":"https://api.github.com/users/zenangst/received_events","type":"User","site_admin":false},"repo":{"id":33930383,"name":"Tailor","full_name":"zenangst/Tailor","owner":{"login":"zenangst","id":57446,"avatar_url":"https://avatars.githubusercontent.com/u/57446?v=3","gravatar_id":"","url":"https://api.github.com/users/zenangst","html_url":"https://github.com/zenangst","followers_url":"https://api.github.com/users/zenangst/followers","following_url":"https://api.github.com/users/zenangst/following{/other_user}","gists_url":"https://api.github.com/users/zenangst/gists{/gist_id}","starred_url":"https://api.github.com/users/zenangst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zenangst/subscriptions","organizations_url":"https://api.github.com/users/zenangst/orgs","repos_url":"https://api.github.com/users/zenangst/repos","events_url":"https://api.github.com/users/zenangst/events{/privacy}","received_events_url":"https://api.github.com/users/zenangst/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zenangst/Tailor","description":"A super fast & convenient object mapper tailored for your needs","fork":false,"url":"https://api.github.com/repos/zenangst/Tailor","forks_url":"https://api.github.com/repos/zenangst/Tailor/forks","keys_url":"https://api.github.com/repos/zenangst/Tailor/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zenangst/Tailor/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zenangst/Tailor/teams","hooks_url":"https://api.github.com/repos/zenangst/Tailor/hooks","issue_events_url":"https://api.github.com/repos/zenangst/Tailor/issues/events{/number}","events_url":"https://api.github.com/repos/zenangst/Tailor/events","assignees_url":"https://api.github.com/repos/zenangst/Tailor/assignees{/user}","branches_url":"https://api.github.com/repos/zenangst/Tailor/branches{/branch}","tags_url":"https://api.github.com/repos/zenangst/Tailor/tags","blobs_url":"https://api.github.com/repos/zenangst/Tailor/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zenangst/Tailor/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zenangst/Tailor/git/refs{/sha}","trees_url":"https://api.github.com/repos/zenangst/Tailor/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zenangst/Tailor/statuses/{sha}","languages_url":"https://api.github.com/repos/zenangst/Tailor/languages","stargazers_url":"https://api.github.com/repos/zenangst/Tailor/stargazers","contributors_url":"https://api.github.com/repos/zenangst/Tailor/contributors","subscribers_url":"https://api.github.com/repos/zenangst/Tailor/subscribers","subscription_url":"https://api.github.com/repos/zenangst/Tailor/subscription","commits_url":"https://api.github.com/repos/zenangst/Tailor/commits{/sha}","git_commits_url":"https://api.github.com/repos/zenangst/Tailor/git/commits{/sha}","comments_url":"https://api.github.com/repos/zenangst/Tailor/comments{/number}","issue_comment_url":"https://api.github.com/repos/zenangst/Tailor/issues/comments{/number}","contents_url":"https://api.github.com/repos/zenangst/Tailor/contents/{+path}","compare_url":"https://api.github.com/repos/zenangst/Tailor/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zenangst/Tailor/merges","archive_url":"https://api.github.com/repos/zenangst/Tailor/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zenangst/Tailor/downloads","issues_url":"https://api.github.com/repos/zenangst/Tailor/issues{/number}","pulls_url":"https://api.github.com/repos/zenangst/Tailor/pulls{/number}","milestones_url":"https://api.github.com/repos/zenangst/Tailor/milestones{/number}","notifications_url":"https://api.github.com/repos/zenangst/Tailor/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zenangst/Tailor/labels{/name}","releases_url":"https://api.github.com/repos/zenangst/Tailor/releases{/id}","deployments_url":"https://api.github.com/repos/zenangst/Tailor/deployments","created_at":"2015-04-14T12:30:30Z","updated_at":"2016-04-25T10:58:20Z","pushed_at":"2016-04-25T10:54:53Z","git_url":"git://github.com/zenangst/Tailor.git","ssh_url":"git@github.com:zenangst/Tailor.git","clone_url":"https://github.com/zenangst/Tailor.git","svn_url":"https://github.com/zenangst/Tailor","homepage":"https://github.com/zenangst","size":547,"stargazers_count":103,"watchers_count":103,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":5,"forks":4,"open_issues":5,"watchers":103,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/zenangst/Tailor/pulls/42"},"html":{"href":"https://github.com/zenangst/Tailor/pull/42"},"issue":{"href":"https://api.github.com/repos/zenangst/Tailor/issues/42"},"comments":{"href":"https://api.github.com/repos/zenangst/Tailor/issues/42/comments"},"review_comments":{"href":"https://api.github.com/repos/zenangst/Tailor/pulls/42/comments"},"review_comment":{"href":"https://api.github.com/repos/zenangst/Tailor/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/zenangst/Tailor/pulls/42/commits"},"statuses":{"href":"https://api.github.com/repos/zenangst/Tailor/statuses/105f95e27bcdbb85ba36c9b03524b55900320756"}}}}