{"action":"created","comment":{"url":"https://api.github.com/repos/paypal/cascade/pulls/comments/25311595","id":25311595,"diff_hunk":"@@ -167,4 +167,20 @@ package object option {\n     def orNil: List[T] = optionList.getOrElse(Nil)\n   }\n \n+  /**\n+   * Convenience methods for working with List[Option[A]]\n+   * @param listOption the List[Option[A]]\n+   */\n+  implicit class ListOption[T](listOption: List[Option[T]]) {\n+\n+    /**\n+     * Converts a List[Option[T]] to an Option[List[T]]\n+     * @return Some[List[T]] if all elements are some, None otherwise.\n+     */\n+    def sequence: Option[List[T]] = {\n+      def addOption(builder: Option[Vector[T]], next: Option[T]): Option[Vector[T]] = builder.flatMap(t => next.map(t :+ _))","path":"common/src/main/scala/com/paypal/cascade/common/option/option.scala","position":15,"original_position":15,"commit_id":"667bf3dc4ca02fec43c9e400ad44acaed9a6e862","original_commit_id":"667bf3dc4ca02fec43c9e400ad44acaed9a6e862","user":{"login":"theanti9","id":92476,"avatar_url":"https://avatars.githubusercontent.com/u/92476?v=3","gravatar_id":"","url":"https://api.github.com/users/theanti9","html_url":"https://github.com/theanti9","followers_url":"https://api.github.com/users/theanti9/followers","following_url":"https://api.github.com/users/theanti9/following{/other_user}","gists_url":"https://api.github.com/users/theanti9/gists{/gist_id}","starred_url":"https://api.github.com/users/theanti9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theanti9/subscriptions","organizations_url":"https://api.github.com/users/theanti9/orgs","repos_url":"https://api.github.com/users/theanti9/repos","events_url":"https://api.github.com/users/theanti9/events{/privacy}","received_events_url":"https://api.github.com/users/theanti9/received_events","type":"User","site_admin":false},"body":"@taylorleese To be perfectly honest, I was just copying @kionka s code, but it seemed like an appropriate choice as it is immutable and has roughly constant append. If we want a strict constant time or just want to be more consistent with the rest of our codebase, we can use a `ListBuffer` which has constant append but is mutable.","created_at":"2015-02-25T01:36:33Z","updated_at":"2015-02-25T01:36:33Z","html_url":"https://github.com/paypal/cascade/pull/94#discussion_r25311595","pull_request_url":"https://api.github.com/repos/paypal/cascade/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/paypal/cascade/pulls/comments/25311595"},"html":{"href":"https://github.com/paypal/cascade/pull/94#discussion_r25311595"},"pull_request":{"href":"https://api.github.com/repos/paypal/cascade/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/paypal/cascade/pulls/94","id":29930887,"html_url":"https://github.com/paypal/cascade/pull/94","diff_url":"https://github.com/paypal/cascade/pull/94.diff","patch_url":"https://github.com/paypal/cascade/pull/94.patch","issue_url":"https://api.github.com/repos/paypal/cascade/issues/94","number":94,"state":"open","locked":false,"title":"Adds option and try sequencing","user":{"login":"theanti9","id":92476,"avatar_url":"https://avatars.githubusercontent.com/u/92476?v=3","gravatar_id":"","url":"https://api.github.com/users/theanti9","html_url":"https://github.com/theanti9","followers_url":"https://api.github.com/users/theanti9/followers","following_url":"https://api.github.com/users/theanti9/following{/other_user}","gists_url":"https://api.github.com/users/theanti9/gists{/gist_id}","starred_url":"https://api.github.com/users/theanti9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theanti9/subscriptions","organizations_url":"https://api.github.com/users/theanti9/orgs","repos_url":"https://api.github.com/users/theanti9/repos","events_url":"https://api.github.com/users/theanti9/events{/privacy}","received_events_url":"https://api.github.com/users/theanti9/received_events","type":"User","site_admin":false},"body":"- Adds implicit class for `List[Option[T]]` to allow `.sequence`. Includes tests\r\n- Adds missing test for the `OptionList` class.\r\n- Adds fairly specific sequencing methods for `Try`s","created_at":"2015-02-24T20:05:00Z","updated_at":"2015-02-25T01:36:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c2c6f2a74fb7dad4b2f6a91747ba3b3432882fc","assignee":{"login":"devmage","id":1923665,"avatar_url":"https://avatars.githubusercontent.com/u/1923665?v=3","gravatar_id":"","url":"https://api.github.com/users/devmage","html_url":"https://github.com/devmage","followers_url":"https://api.github.com/users/devmage/followers","following_url":"https://api.github.com/users/devmage/following{/other_user}","gists_url":"https://api.github.com/users/devmage/gists{/gist_id}","starred_url":"https://api.github.com/users/devmage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devmage/subscriptions","organizations_url":"https://api.github.com/users/devmage/orgs","repos_url":"https://api.github.com/users/devmage/repos","events_url":"https://api.github.com/users/devmage/events{/privacy}","received_events_url":"https://api.github.com/users/devmage/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/paypal/cascade/pulls/94/commits","review_comments_url":"https://api.github.com/repos/paypal/cascade/pulls/94/comments","review_comment_url":"https://api.github.com/repos/paypal/cascade/pulls/comments{/number}","comments_url":"https://api.github.com/repos/paypal/cascade/issues/94/comments","statuses_url":"https://api.github.com/repos/paypal/cascade/statuses/667bf3dc4ca02fec43c9e400ad44acaed9a6e862","head":{"label":"paypal:feature/option-sequencing","ref":"feature/option-sequencing","sha":"667bf3dc4ca02fec43c9e400ad44acaed9a6e862","user":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"repo":{"id":23116994,"name":"cascade","full_name":"paypal/cascade","owner":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paypal/cascade","description":"Common Libraries & Patterns for Scala Apps @ PayPal","fork":false,"url":"https://api.github.com/repos/paypal/cascade","forks_url":"https://api.github.com/repos/paypal/cascade/forks","keys_url":"https://api.github.com/repos/paypal/cascade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paypal/cascade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paypal/cascade/teams","hooks_url":"https://api.github.com/repos/paypal/cascade/hooks","issue_events_url":"https://api.github.com/repos/paypal/cascade/issues/events{/number}","events_url":"https://api.github.com/repos/paypal/cascade/events","assignees_url":"https://api.github.com/repos/paypal/cascade/assignees{/user}","branches_url":"https://api.github.com/repos/paypal/cascade/branches{/branch}","tags_url":"https://api.github.com/repos/paypal/cascade/tags","blobs_url":"https://api.github.com/repos/paypal/cascade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paypal/cascade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paypal/cascade/git/refs{/sha}","trees_url":"https://api.github.com/repos/paypal/cascade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paypal/cascade/statuses/{sha}","languages_url":"https://api.github.com/repos/paypal/cascade/languages","stargazers_url":"https://api.github.com/repos/paypal/cascade/stargazers","contributors_url":"https://api.github.com/repos/paypal/cascade/contributors","subscribers_url":"https://api.github.com/repos/paypal/cascade/subscribers","subscription_url":"https://api.github.com/repos/paypal/cascade/subscription","commits_url":"https://api.github.com/repos/paypal/cascade/commits{/sha}","git_commits_url":"https://api.github.com/repos/paypal/cascade/git/commits{/sha}","comments_url":"https://api.github.com/repos/paypal/cascade/comments{/number}","issue_comment_url":"https://api.github.com/repos/paypal/cascade/issues/comments{/number}","contents_url":"https://api.github.com/repos/paypal/cascade/contents/{+path}","compare_url":"https://api.github.com/repos/paypal/cascade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paypal/cascade/merges","archive_url":"https://api.github.com/repos/paypal/cascade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paypal/cascade/downloads","issues_url":"https://api.github.com/repos/paypal/cascade/issues{/number}","pulls_url":"https://api.github.com/repos/paypal/cascade/pulls{/number}","milestones_url":"https://api.github.com/repos/paypal/cascade/milestones{/number}","notifications_url":"https://api.github.com/repos/paypal/cascade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paypal/cascade/labels{/name}","releases_url":"https://api.github.com/repos/paypal/cascade/releases{/id}","created_at":"2014-08-19T16:18:16Z","updated_at":"2015-02-17T06:44:37Z","pushed_at":"2015-02-25T00:02:49Z","git_url":"git://github.com/paypal/cascade.git","ssh_url":"git@github.com:paypal/cascade.git","clone_url":"https://github.com/paypal/cascade.git","svn_url":"https://github.com/paypal/cascade","homepage":null,"size":3374,"stargazers_count":95,"watchers_count":95,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":14,"forks":10,"open_issues":14,"watchers":95,"default_branch":"develop"}},"base":{"label":"paypal:develop","ref":"develop","sha":"03d3ee17189251dc9a3d93d4db0b05115498f2a7","user":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"repo":{"id":23116994,"name":"cascade","full_name":"paypal/cascade","owner":{"login":"paypal","id":476675,"avatar_url":"https://avatars.githubusercontent.com/u/476675?v=3","gravatar_id":"","url":"https://api.github.com/users/paypal","html_url":"https://github.com/paypal","followers_url":"https://api.github.com/users/paypal/followers","following_url":"https://api.github.com/users/paypal/following{/other_user}","gists_url":"https://api.github.com/users/paypal/gists{/gist_id}","starred_url":"https://api.github.com/users/paypal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paypal/subscriptions","organizations_url":"https://api.github.com/users/paypal/orgs","repos_url":"https://api.github.com/users/paypal/repos","events_url":"https://api.github.com/users/paypal/events{/privacy}","received_events_url":"https://api.github.com/users/paypal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/paypal/cascade","description":"Common Libraries & Patterns for Scala Apps @ PayPal","fork":false,"url":"https://api.github.com/repos/paypal/cascade","forks_url":"https://api.github.com/repos/paypal/cascade/forks","keys_url":"https://api.github.com/repos/paypal/cascade/keys{/key_id}","collaborators_url":"https://api.github.com/repos/paypal/cascade/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/paypal/cascade/teams","hooks_url":"https://api.github.com/repos/paypal/cascade/hooks","issue_events_url":"https://api.github.com/repos/paypal/cascade/issues/events{/number}","events_url":"https://api.github.com/repos/paypal/cascade/events","assignees_url":"https://api.github.com/repos/paypal/cascade/assignees{/user}","branches_url":"https://api.github.com/repos/paypal/cascade/branches{/branch}","tags_url":"https://api.github.com/repos/paypal/cascade/tags","blobs_url":"https://api.github.com/repos/paypal/cascade/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/paypal/cascade/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/paypal/cascade/git/refs{/sha}","trees_url":"https://api.github.com/repos/paypal/cascade/git/trees{/sha}","statuses_url":"https://api.github.com/repos/paypal/cascade/statuses/{sha}","languages_url":"https://api.github.com/repos/paypal/cascade/languages","stargazers_url":"https://api.github.com/repos/paypal/cascade/stargazers","contributors_url":"https://api.github.com/repos/paypal/cascade/contributors","subscribers_url":"https://api.github.com/repos/paypal/cascade/subscribers","subscription_url":"https://api.github.com/repos/paypal/cascade/subscription","commits_url":"https://api.github.com/repos/paypal/cascade/commits{/sha}","git_commits_url":"https://api.github.com/repos/paypal/cascade/git/commits{/sha}","comments_url":"https://api.github.com/repos/paypal/cascade/comments{/number}","issue_comment_url":"https://api.github.com/repos/paypal/cascade/issues/comments{/number}","contents_url":"https://api.github.com/repos/paypal/cascade/contents/{+path}","compare_url":"https://api.github.com/repos/paypal/cascade/compare/{base}...{head}","merges_url":"https://api.github.com/repos/paypal/cascade/merges","archive_url":"https://api.github.com/repos/paypal/cascade/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/paypal/cascade/downloads","issues_url":"https://api.github.com/repos/paypal/cascade/issues{/number}","pulls_url":"https://api.github.com/repos/paypal/cascade/pulls{/number}","milestones_url":"https://api.github.com/repos/paypal/cascade/milestones{/number}","notifications_url":"https://api.github.com/repos/paypal/cascade/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/paypal/cascade/labels{/name}","releases_url":"https://api.github.com/repos/paypal/cascade/releases{/id}","created_at":"2014-08-19T16:18:16Z","updated_at":"2015-02-17T06:44:37Z","pushed_at":"2015-02-25T00:02:49Z","git_url":"git://github.com/paypal/cascade.git","ssh_url":"git@github.com:paypal/cascade.git","clone_url":"https://github.com/paypal/cascade.git","svn_url":"https://github.com/paypal/cascade","homepage":null,"size":3374,"stargazers_count":95,"watchers_count":95,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":10,"mirror_url":null,"open_issues_count":14,"forks":10,"open_issues":14,"watchers":95,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/paypal/cascade/pulls/94"},"html":{"href":"https://github.com/paypal/cascade/pull/94"},"issue":{"href":"https://api.github.com/repos/paypal/cascade/issues/94"},"comments":{"href":"https://api.github.com/repos/paypal/cascade/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/paypal/cascade/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/paypal/cascade/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/paypal/cascade/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/paypal/cascade/statuses/667bf3dc4ca02fec43c9e400ad44acaed9a6e862"}}}}