{"action":"created","comment":{"url":"https://api.github.com/repos/fsprojects/Chessie/pulls/comments/34764787","id":34764787,"diff_hunk":"@@ -108,4 +108,86 @@ We can even use pattern matching on the result:\n         });\n \n The thing to note here is how the Validations can be composed together in a computation expression.\n-The type system is making sure that failures flow through your computation in a safe manner.\n\\ No newline at end of file\n+The type system is making sure that failures flow through your computation in a safe manner.\n+\n+## Part Two : Club Tropicana\n+\n+Part One showed monadic composition, which from the perspective of Validation is *fail-fast*. That is, any failed check short-circuits subsequent checks. This nicely models nightclubs in the real world, as anyone who has dashed home for a pair of smart shoes and returned, only to be told that your tie does not pass muster, will attest.\n+\n+But what about an ideal nightclub? One that tells you *everything* that is wrong with you.\n+\n+Applicative functors to the rescue!\n+\n+Let's compose some validation checks that accumulate failures using LINQ sugar:\n+\n+    [lang=csharp]\n+    class ClubTropicana\n+    {\n+        public static Result<decimal, string> CostToEnter(Person p)\n+        {\n+            return from c in Club.CheckAge(p)\n+                    join x in Club.CheckClothes(p) on 1 equals 1\n+                    join y in Club.CheckSobriety(p) on 1 equals 1\n+                    select c.Gender == Gender.Female ? 0m : 7.5m;\n+        }\n+    }\n+\n+And the use? Dave tried the second nightclub after a few more drinks in the pub:","path":"docs/content/a-tale-of-3-nightclubs.md","position":null,"original_position":39,"commit_id":"e4a805ae7f8e45b4d87d1a4fb3d0cd85af91248c","original_commit_id":"99c21e0977cb13d5a28cc27b21ba252ddae44f62","user":{"login":"battermann","id":3968185,"avatar_url":"https://avatars.githubusercontent.com/u/3968185?v=3","gravatar_id":"","url":"https://api.github.com/users/battermann","html_url":"https://github.com/battermann","followers_url":"https://api.github.com/users/battermann/followers","following_url":"https://api.github.com/users/battermann/following{/other_user}","gists_url":"https://api.github.com/users/battermann/gists{/gist_id}","starred_url":"https://api.github.com/users/battermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/battermann/subscriptions","organizations_url":"https://api.github.com/users/battermann/orgs","repos_url":"https://api.github.com/users/battermann/repos","events_url":"https://api.github.com/users/battermann/events{/privacy}","received_events_url":"https://api.github.com/users/battermann/received_events","type":"User","site_admin":false},"body":"done","created_at":"2015-07-16T08:16:31Z","updated_at":"2015-07-16T08:16:31Z","html_url":"https://github.com/fsprojects/Chessie/pull/23#discussion_r34764787","pull_request_url":"https://api.github.com/repos/fsprojects/Chessie/pulls/23","_links":{"self":{"href":"https://api.github.com/repos/fsprojects/Chessie/pulls/comments/34764787"},"html":{"href":"https://github.com/fsprojects/Chessie/pull/23#discussion_r34764787"},"pull_request":{"href":"https://api.github.com/repos/fsprojects/Chessie/pulls/23"}}},"pull_request":{"url":"https://api.github.com/repos/fsprojects/Chessie/pulls/23","id":38911825,"html_url":"https://github.com/fsprojects/Chessie/pull/23","diff_url":"https://github.com/fsprojects/Chessie/pull/23.diff","patch_url":"https://github.com/fsprojects/Chessie/pull/23.patch","issue_url":"https://api.github.com/repos/fsprojects/Chessie/issues/23","number":23,"state":"open","locked":false,"title":"Port over the rest of a tale of 3 nightclubs","user":{"login":"battermann","id":3968185,"avatar_url":"https://avatars.githubusercontent.com/u/3968185?v=3","gravatar_id":"","url":"https://api.github.com/users/battermann","html_url":"https://github.com/battermann","followers_url":"https://api.github.com/users/battermann/followers","following_url":"https://api.github.com/users/battermann/following{/other_user}","gists_url":"https://api.github.com/users/battermann/gists{/gist_id}","starred_url":"https://api.github.com/users/battermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/battermann/subscriptions","organizations_url":"https://api.github.com/users/battermann/orgs","repos_url":"https://api.github.com/users/battermann/repos","events_url":"https://api.github.com/users/battermann/events{/privacy}","received_events_url":"https://api.github.com/users/battermann/received_events","type":"User","site_admin":false},"body":"#14 Done\r\n\r\n## To-Do\r\n- [x] port test 2 (partially)\r\n- [x] add extension method Join to support C# LINQ query syntax\r\n- [x] add source code comments\r\n- [x] update API reference\r\n- [x] update C# tutorial \"A Tale of 3 Nightclubs\"\r\n- [x] port the rest of part 2\r\n- [x] port part 3","created_at":"2015-06-30T18:54:34Z","updated_at":"2015-07-16T08:16:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b12ea71aa2b187671b7a43b53f9ee0522be5e825","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fsprojects/Chessie/pulls/23/commits","review_comments_url":"https://api.github.com/repos/fsprojects/Chessie/pulls/23/comments","review_comment_url":"https://api.github.com/repos/fsprojects/Chessie/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fsprojects/Chessie/issues/23/comments","statuses_url":"https://api.github.com/repos/fsprojects/Chessie/statuses/e4a805ae7f8e45b4d87d1a4fb3d0cd85af91248c","head":{"label":"battermann:Port_over_the_rest_of_A_Tale_of_3_Nightclubs","ref":"Port_over_the_rest_of_A_Tale_of_3_Nightclubs","sha":"e4a805ae7f8e45b4d87d1a4fb3d0cd85af91248c","user":{"login":"battermann","id":3968185,"avatar_url":"https://avatars.githubusercontent.com/u/3968185?v=3","gravatar_id":"","url":"https://api.github.com/users/battermann","html_url":"https://github.com/battermann","followers_url":"https://api.github.com/users/battermann/followers","following_url":"https://api.github.com/users/battermann/following{/other_user}","gists_url":"https://api.github.com/users/battermann/gists{/gist_id}","starred_url":"https://api.github.com/users/battermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/battermann/subscriptions","organizations_url":"https://api.github.com/users/battermann/orgs","repos_url":"https://api.github.com/users/battermann/repos","events_url":"https://api.github.com/users/battermann/events{/privacy}","received_events_url":"https://api.github.com/users/battermann/received_events","type":"User","site_admin":false},"repo":{"id":38212101,"name":"Chessie","full_name":"battermann/Chessie","owner":{"login":"battermann","id":3968185,"avatar_url":"https://avatars.githubusercontent.com/u/3968185?v=3","gravatar_id":"","url":"https://api.github.com/users/battermann","html_url":"https://github.com/battermann","followers_url":"https://api.github.com/users/battermann/followers","following_url":"https://api.github.com/users/battermann/following{/other_user}","gists_url":"https://api.github.com/users/battermann/gists{/gist_id}","starred_url":"https://api.github.com/users/battermann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/battermann/subscriptions","organizations_url":"https://api.github.com/users/battermann/orgs","repos_url":"https://api.github.com/users/battermann/repos","events_url":"https://api.github.com/users/battermann/events{/privacy}","received_events_url":"https://api.github.com/users/battermann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/battermann/Chessie","description":"Railway-oriented programming for .NET","fork":true,"url":"https://api.github.com/repos/battermann/Chessie","forks_url":"https://api.github.com/repos/battermann/Chessie/forks","keys_url":"https://api.github.com/repos/battermann/Chessie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/battermann/Chessie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/battermann/Chessie/teams","hooks_url":"https://api.github.com/repos/battermann/Chessie/hooks","issue_events_url":"https://api.github.com/repos/battermann/Chessie/issues/events{/number}","events_url":"https://api.github.com/repos/battermann/Chessie/events","assignees_url":"https://api.github.com/repos/battermann/Chessie/assignees{/user}","branches_url":"https://api.github.com/repos/battermann/Chessie/branches{/branch}","tags_url":"https://api.github.com/repos/battermann/Chessie/tags","blobs_url":"https://api.github.com/repos/battermann/Chessie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/battermann/Chessie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/battermann/Chessie/git/refs{/sha}","trees_url":"https://api.github.com/repos/battermann/Chessie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/battermann/Chessie/statuses/{sha}","languages_url":"https://api.github.com/repos/battermann/Chessie/languages","stargazers_url":"https://api.github.com/repos/battermann/Chessie/stargazers","contributors_url":"https://api.github.com/repos/battermann/Chessie/contributors","subscribers_url":"https://api.github.com/repos/battermann/Chessie/subscribers","subscription_url":"https://api.github.com/repos/battermann/Chessie/subscription","commits_url":"https://api.github.com/repos/battermann/Chessie/commits{/sha}","git_commits_url":"https://api.github.com/repos/battermann/Chessie/git/commits{/sha}","comments_url":"https://api.github.com/repos/battermann/Chessie/comments{/number}","issue_comment_url":"https://api.github.com/repos/battermann/Chessie/issues/comments{/number}","contents_url":"https://api.github.com/repos/battermann/Chessie/contents/{+path}","compare_url":"https://api.github.com/repos/battermann/Chessie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/battermann/Chessie/merges","archive_url":"https://api.github.com/repos/battermann/Chessie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/battermann/Chessie/downloads","issues_url":"https://api.github.com/repos/battermann/Chessie/issues{/number}","pulls_url":"https://api.github.com/repos/battermann/Chessie/pulls{/number}","milestones_url":"https://api.github.com/repos/battermann/Chessie/milestones{/number}","notifications_url":"https://api.github.com/repos/battermann/Chessie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/battermann/Chessie/labels{/name}","releases_url":"https://api.github.com/repos/battermann/Chessie/releases{/id}","created_at":"2015-06-28T19:55:33Z","updated_at":"2015-06-28T19:55:33Z","pushed_at":"2015-07-16T08:16:12Z","git_url":"git://github.com/battermann/Chessie.git","ssh_url":"git@github.com:battermann/Chessie.git","clone_url":"https://github.com/battermann/Chessie.git","svn_url":"https://github.com/battermann/Chessie","homepage":"http://fsprojects.github.io/Chessie/","size":473,"stargazers_count":0,"watchers_count":0,"language":"F#","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fsprojects:master","ref":"master","sha":"7c31c30f70b1fb12401471642904c3d17f58c9cc","user":{"login":"fsprojects","id":6001315,"avatar_url":"https://avatars.githubusercontent.com/u/6001315?v=3","gravatar_id":"","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"repo":{"id":31379993,"name":"Chessie","full_name":"fsprojects/Chessie","owner":{"login":"fsprojects","id":6001315,"avatar_url":"https://avatars.githubusercontent.com/u/6001315?v=3","gravatar_id":"","url":"https://api.github.com/users/fsprojects","html_url":"https://github.com/fsprojects","followers_url":"https://api.github.com/users/fsprojects/followers","following_url":"https://api.github.com/users/fsprojects/following{/other_user}","gists_url":"https://api.github.com/users/fsprojects/gists{/gist_id}","starred_url":"https://api.github.com/users/fsprojects/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fsprojects/subscriptions","organizations_url":"https://api.github.com/users/fsprojects/orgs","repos_url":"https://api.github.com/users/fsprojects/repos","events_url":"https://api.github.com/users/fsprojects/events{/privacy}","received_events_url":"https://api.github.com/users/fsprojects/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fsprojects/Chessie","description":"Railway-oriented programming for .NET","fork":false,"url":"https://api.github.com/repos/fsprojects/Chessie","forks_url":"https://api.github.com/repos/fsprojects/Chessie/forks","keys_url":"https://api.github.com/repos/fsprojects/Chessie/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fsprojects/Chessie/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fsprojects/Chessie/teams","hooks_url":"https://api.github.com/repos/fsprojects/Chessie/hooks","issue_events_url":"https://api.github.com/repos/fsprojects/Chessie/issues/events{/number}","events_url":"https://api.github.com/repos/fsprojects/Chessie/events","assignees_url":"https://api.github.com/repos/fsprojects/Chessie/assignees{/user}","branches_url":"https://api.github.com/repos/fsprojects/Chessie/branches{/branch}","tags_url":"https://api.github.com/repos/fsprojects/Chessie/tags","blobs_url":"https://api.github.com/repos/fsprojects/Chessie/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fsprojects/Chessie/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fsprojects/Chessie/git/refs{/sha}","trees_url":"https://api.github.com/repos/fsprojects/Chessie/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fsprojects/Chessie/statuses/{sha}","languages_url":"https://api.github.com/repos/fsprojects/Chessie/languages","stargazers_url":"https://api.github.com/repos/fsprojects/Chessie/stargazers","contributors_url":"https://api.github.com/repos/fsprojects/Chessie/contributors","subscribers_url":"https://api.github.com/repos/fsprojects/Chessie/subscribers","subscription_url":"https://api.github.com/repos/fsprojects/Chessie/subscription","commits_url":"https://api.github.com/repos/fsprojects/Chessie/commits{/sha}","git_commits_url":"https://api.github.com/repos/fsprojects/Chessie/git/commits{/sha}","comments_url":"https://api.github.com/repos/fsprojects/Chessie/comments{/number}","issue_comment_url":"https://api.github.com/repos/fsprojects/Chessie/issues/comments{/number}","contents_url":"https://api.github.com/repos/fsprojects/Chessie/contents/{+path}","compare_url":"https://api.github.com/repos/fsprojects/Chessie/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fsprojects/Chessie/merges","archive_url":"https://api.github.com/repos/fsprojects/Chessie/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fsprojects/Chessie/downloads","issues_url":"https://api.github.com/repos/fsprojects/Chessie/issues{/number}","pulls_url":"https://api.github.com/repos/fsprojects/Chessie/pulls{/number}","milestones_url":"https://api.github.com/repos/fsprojects/Chessie/milestones{/number}","notifications_url":"https://api.github.com/repos/fsprojects/Chessie/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fsprojects/Chessie/labels{/name}","releases_url":"https://api.github.com/repos/fsprojects/Chessie/releases{/id}","created_at":"2015-02-26T17:44:12Z","updated_at":"2015-06-26T15:25:11Z","pushed_at":"2015-07-16T08:16:12Z","git_url":"git://github.com/fsprojects/Chessie.git","ssh_url":"git@github.com:fsprojects/Chessie.git","clone_url":"https://github.com/fsprojects/Chessie.git","svn_url":"https://github.com/fsprojects/Chessie","homepage":"http://fsprojects.github.io/Chessie/","size":811,"stargazers_count":36,"watchers_count":36,"language":"F#","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":5,"forks":17,"open_issues":5,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fsprojects/Chessie/pulls/23"},"html":{"href":"https://github.com/fsprojects/Chessie/pull/23"},"issue":{"href":"https://api.github.com/repos/fsprojects/Chessie/issues/23"},"comments":{"href":"https://api.github.com/repos/fsprojects/Chessie/issues/23/comments"},"review_comments":{"href":"https://api.github.com/repos/fsprojects/Chessie/pulls/23/comments"},"review_comment":{"href":"https://api.github.com/repos/fsprojects/Chessie/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fsprojects/Chessie/pulls/23/commits"},"statuses":{"href":"https://api.github.com/repos/fsprojects/Chessie/statuses/e4a805ae7f8e45b4d87d1a4fb3d0cd85af91248c"}}}}