{"action":"created","comment":{"url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/comments/185678140","pull_request_review_id":117115567,"id":185678140,"diff_hunk":"@@ -49,15 +49,28 @@ object TryExercises {\n \n   /**\n     * scala> parseBooleanSafe(\"true\")\n-    * = Right(true)\n+    * = Success(true)\n     *\n     * scala> parseBooleanSafe(\"abc\")\n-    * = Left(TryError(\"abc cannot be converted to Boolean\"))\n+    * = Failure(TryError(\"abc cannot be converted to Boolean\"))\n     *\n     * Hint: Use .toBoolean to convert a String to a Boolean\n     **/\n   def parseBooleanSafe(str: String): Try[Boolean] = ???\n \n+\n+  /**\n+    * scala> increment(\"10\")\n+    * = Success(11)\n+    *\n+    * scala> increment(\"NaN\")\n+    * = Failure(TryError(\"NaN is not a valid number\"))","path":"src/main/scala/fundamentals/level03/TryExercises.scala","position":21,"original_position":21,"commit_id":"74a19eaf5fb4751f8807f618df463baeb8cf66e7","original_commit_id":"74a19eaf5fb4751f8807f618df463baeb8cf66e7","user":{"login":"sanjivsahayamrea","id":29850472,"avatar_url":"https://avatars2.githubusercontent.com/u/29850472?v=4","gravatar_id":"","url":"https://api.github.com/users/sanjivsahayamrea","html_url":"https://github.com/sanjivsahayamrea","followers_url":"https://api.github.com/users/sanjivsahayamrea/followers","following_url":"https://api.github.com/users/sanjivsahayamrea/following{/other_user}","gists_url":"https://api.github.com/users/sanjivsahayamrea/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjivsahayamrea/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjivsahayamrea/subscriptions","organizations_url":"https://api.github.com/users/sanjivsahayamrea/orgs","repos_url":"https://api.github.com/users/sanjivsahayamrea/repos","events_url":"https://api.github.com/users/sanjivsahayamrea/events{/privacy}","received_events_url":"https://api.github.com/users/sanjivsahayamrea/received_events","type":"User","site_admin":false},"body":"where do we get `TryError` from? Shouldn't this be an `Exception`?","created_at":"2018-05-03T00:51:45Z","updated_at":"2018-05-03T00:51:45Z","html_url":"https://github.com/wjlow/intro-to-scala/pull/68#discussion_r185678140","pull_request_url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/comments/185678140"},"html":{"href":"https://github.com/wjlow/intro-to-scala/pull/68#discussion_r185678140"},"pull_request":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68","id":185573790,"html_url":"https://github.com/wjlow/intro-to-scala/pull/68","diff_url":"https://github.com/wjlow/intro-to-scala/pull/68.diff","patch_url":"https://github.com/wjlow/intro-to-scala/pull/68.patch","issue_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues/68","number":68,"state":"open","locked":false,"title":"Add .map example to Try","user":{"login":"ashokkumar","id":153482,"avatar_url":"https://avatars3.githubusercontent.com/u/153482?v=4","gravatar_id":"","url":"https://api.github.com/users/ashokkumar","html_url":"https://github.com/ashokkumar","followers_url":"https://api.github.com/users/ashokkumar/followers","following_url":"https://api.github.com/users/ashokkumar/following{/other_user}","gists_url":"https://api.github.com/users/ashokkumar/gists{/gist_id}","starred_url":"https://api.github.com/users/ashokkumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashokkumar/subscriptions","organizations_url":"https://api.github.com/users/ashokkumar/orgs","repos_url":"https://api.github.com/users/ashokkumar/repos","events_url":"https://api.github.com/users/ashokkumar/events{/privacy}","received_events_url":"https://api.github.com/users/ashokkumar/received_events","type":"User","site_admin":false},"body":"As we have a for comprehension exercise, felt that we should introduce .map to Try before that. \r\n\r\nI thought of introducing \r\n\r\n```\r\n  def intOperation(str: String, f: Int => Int): Try[Int] = ???\r\n```\r\n\r\nthen thought it might be too difficult, what's your thought on that @wjlow @sanjivsahayamrea  ","created_at":"2018-05-02T22:05:54Z","updated_at":"2018-05-03T00:51:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2b11c88fd39600d1f9eee6adcbac04ef4dbafbbb","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68/commits","review_comments_url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68/comments","review_comment_url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues/68/comments","statuses_url":"https://api.github.com/repos/wjlow/intro-to-scala/statuses/74a19eaf5fb4751f8807f618df463baeb8cf66e7","head":{"label":"wjlow:map-to-try","ref":"map-to-try","sha":"74a19eaf5fb4751f8807f618df463baeb8cf66e7","user":{"login":"wjlow","id":368630,"avatar_url":"https://avatars3.githubusercontent.com/u/368630?v=4","gravatar_id":"","url":"https://api.github.com/users/wjlow","html_url":"https://github.com/wjlow","followers_url":"https://api.github.com/users/wjlow/followers","following_url":"https://api.github.com/users/wjlow/following{/other_user}","gists_url":"https://api.github.com/users/wjlow/gists{/gist_id}","starred_url":"https://api.github.com/users/wjlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjlow/subscriptions","organizations_url":"https://api.github.com/users/wjlow/orgs","repos_url":"https://api.github.com/users/wjlow/repos","events_url":"https://api.github.com/users/wjlow/events{/privacy}","received_events_url":"https://api.github.com/users/wjlow/received_events","type":"User","site_admin":false},"repo":{"id":122430187,"name":"intro-to-scala","full_name":"wjlow/intro-to-scala","owner":{"login":"wjlow","id":368630,"avatar_url":"https://avatars3.githubusercontent.com/u/368630?v=4","gravatar_id":"","url":"https://api.github.com/users/wjlow","html_url":"https://github.com/wjlow","followers_url":"https://api.github.com/users/wjlow/followers","following_url":"https://api.github.com/users/wjlow/following{/other_user}","gists_url":"https://api.github.com/users/wjlow/gists{/gist_id}","starred_url":"https://api.github.com/users/wjlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjlow/subscriptions","organizations_url":"https://api.github.com/users/wjlow/orgs","repos_url":"https://api.github.com/users/wjlow/repos","events_url":"https://api.github.com/users/wjlow/events{/privacy}","received_events_url":"https://api.github.com/users/wjlow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wjlow/intro-to-scala","description":null,"fork":false,"url":"https://api.github.com/repos/wjlow/intro-to-scala","forks_url":"https://api.github.com/repos/wjlow/intro-to-scala/forks","keys_url":"https://api.github.com/repos/wjlow/intro-to-scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wjlow/intro-to-scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wjlow/intro-to-scala/teams","hooks_url":"https://api.github.com/repos/wjlow/intro-to-scala/hooks","issue_events_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues/events{/number}","events_url":"https://api.github.com/repos/wjlow/intro-to-scala/events","assignees_url":"https://api.github.com/repos/wjlow/intro-to-scala/assignees{/user}","branches_url":"https://api.github.com/repos/wjlow/intro-to-scala/branches{/branch}","tags_url":"https://api.github.com/repos/wjlow/intro-to-scala/tags","blobs_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wjlow/intro-to-scala/statuses/{sha}","languages_url":"https://api.github.com/repos/wjlow/intro-to-scala/languages","stargazers_url":"https://api.github.com/repos/wjlow/intro-to-scala/stargazers","contributors_url":"https://api.github.com/repos/wjlow/intro-to-scala/contributors","subscribers_url":"https://api.github.com/repos/wjlow/intro-to-scala/subscribers","subscription_url":"https://api.github.com/repos/wjlow/intro-to-scala/subscription","commits_url":"https://api.github.com/repos/wjlow/intro-to-scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/wjlow/intro-to-scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/wjlow/intro-to-scala/contents/{+path}","compare_url":"https://api.github.com/repos/wjlow/intro-to-scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wjlow/intro-to-scala/merges","archive_url":"https://api.github.com/repos/wjlow/intro-to-scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wjlow/intro-to-scala/downloads","issues_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues{/number}","pulls_url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls{/number}","milestones_url":"https://api.github.com/repos/wjlow/intro-to-scala/milestones{/number}","notifications_url":"https://api.github.com/repos/wjlow/intro-to-scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wjlow/intro-to-scala/labels{/name}","releases_url":"https://api.github.com/repos/wjlow/intro-to-scala/releases{/id}","deployments_url":"https://api.github.com/repos/wjlow/intro-to-scala/deployments","created_at":"2018-02-22T04:22:38Z","updated_at":"2018-05-03T00:38:37Z","pushed_at":"2018-05-03T00:48:31Z","git_url":"git://github.com/wjlow/intro-to-scala.git","ssh_url":"git@github.com:wjlow/intro-to-scala.git","clone_url":"https://github.com/wjlow/intro-to-scala.git","svn_url":"https://github.com/wjlow/intro-to-scala","homepage":null,"size":1835,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":7,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"wjlow:master","ref":"master","sha":"27fa6f70e65229649ab29d0d92c7b6bd1458443b","user":{"login":"wjlow","id":368630,"avatar_url":"https://avatars3.githubusercontent.com/u/368630?v=4","gravatar_id":"","url":"https://api.github.com/users/wjlow","html_url":"https://github.com/wjlow","followers_url":"https://api.github.com/users/wjlow/followers","following_url":"https://api.github.com/users/wjlow/following{/other_user}","gists_url":"https://api.github.com/users/wjlow/gists{/gist_id}","starred_url":"https://api.github.com/users/wjlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjlow/subscriptions","organizations_url":"https://api.github.com/users/wjlow/orgs","repos_url":"https://api.github.com/users/wjlow/repos","events_url":"https://api.github.com/users/wjlow/events{/privacy}","received_events_url":"https://api.github.com/users/wjlow/received_events","type":"User","site_admin":false},"repo":{"id":122430187,"name":"intro-to-scala","full_name":"wjlow/intro-to-scala","owner":{"login":"wjlow","id":368630,"avatar_url":"https://avatars3.githubusercontent.com/u/368630?v=4","gravatar_id":"","url":"https://api.github.com/users/wjlow","html_url":"https://github.com/wjlow","followers_url":"https://api.github.com/users/wjlow/followers","following_url":"https://api.github.com/users/wjlow/following{/other_user}","gists_url":"https://api.github.com/users/wjlow/gists{/gist_id}","starred_url":"https://api.github.com/users/wjlow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjlow/subscriptions","organizations_url":"https://api.github.com/users/wjlow/orgs","repos_url":"https://api.github.com/users/wjlow/repos","events_url":"https://api.github.com/users/wjlow/events{/privacy}","received_events_url":"https://api.github.com/users/wjlow/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wjlow/intro-to-scala","description":null,"fork":false,"url":"https://api.github.com/repos/wjlow/intro-to-scala","forks_url":"https://api.github.com/repos/wjlow/intro-to-scala/forks","keys_url":"https://api.github.com/repos/wjlow/intro-to-scala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wjlow/intro-to-scala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wjlow/intro-to-scala/teams","hooks_url":"https://api.github.com/repos/wjlow/intro-to-scala/hooks","issue_events_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues/events{/number}","events_url":"https://api.github.com/repos/wjlow/intro-to-scala/events","assignees_url":"https://api.github.com/repos/wjlow/intro-to-scala/assignees{/user}","branches_url":"https://api.github.com/repos/wjlow/intro-to-scala/branches{/branch}","tags_url":"https://api.github.com/repos/wjlow/intro-to-scala/tags","blobs_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/refs{/sha}","trees_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wjlow/intro-to-scala/statuses/{sha}","languages_url":"https://api.github.com/repos/wjlow/intro-to-scala/languages","stargazers_url":"https://api.github.com/repos/wjlow/intro-to-scala/stargazers","contributors_url":"https://api.github.com/repos/wjlow/intro-to-scala/contributors","subscribers_url":"https://api.github.com/repos/wjlow/intro-to-scala/subscribers","subscription_url":"https://api.github.com/repos/wjlow/intro-to-scala/subscription","commits_url":"https://api.github.com/repos/wjlow/intro-to-scala/commits{/sha}","git_commits_url":"https://api.github.com/repos/wjlow/intro-to-scala/git/commits{/sha}","comments_url":"https://api.github.com/repos/wjlow/intro-to-scala/comments{/number}","issue_comment_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues/comments{/number}","contents_url":"https://api.github.com/repos/wjlow/intro-to-scala/contents/{+path}","compare_url":"https://api.github.com/repos/wjlow/intro-to-scala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wjlow/intro-to-scala/merges","archive_url":"https://api.github.com/repos/wjlow/intro-to-scala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wjlow/intro-to-scala/downloads","issues_url":"https://api.github.com/repos/wjlow/intro-to-scala/issues{/number}","pulls_url":"https://api.github.com/repos/wjlow/intro-to-scala/pulls{/number}","milestones_url":"https://api.github.com/repos/wjlow/intro-to-scala/milestones{/number}","notifications_url":"https://api.github.com/repos/wjlow/intro-to-scala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wjlow/intro-to-scala/labels{/name}","releases_url":"https://api.github.com/repos/wjlow/intro-to-scala/releases{/id}","deployments_url":"https://api.github.com/repos/wjlow/intro-to-scala/deployments","created_at":"2018-02-22T04:22:38Z","updated_at":"2018-05-03T00:38:37Z","pushed_at":"2018-05-03T00:48:31Z","git_url":"git://github.com/wjlow/intro-to-scala.git","ssh_url":"git@github.com:wjlow/intro-to-scala.git","clone_url":"https://github.com/wjlow/intro-to-scala.git","svn_url":"https://github.com/wjlow/intro-to-scala","homepage":null,"size":1835,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7,"mirror_url":null,"archived":false,"open_issues_count":5,"license":null,"forks":7,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68"},"html":{"href":"https://github.com/wjlow/intro-to-scala/pull/68"},"issue":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/issues/68"},"comments":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/wjlow/intro-to-scala/statuses/74a19eaf5fb4751f8807f618df463baeb8cf66e7"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"sanjivsahayamrea"}}