{"action":"created","comment":{"url":"https://api.github.com/repos/typelift/Aquifer/pulls/comments/38165207","id":38165207,"diff_hunk":"@@ -0,0 +1,658 @@\n+// Copyright (c) 2012-2014 Gabriel Gonzalez\n+// All rights reserved.\n+//\t\n+// Redistribution and use in source and binary forms, with or without modification,\n+// are permitted provided that the following conditions are met:\n+// * Redistributions of source code must retain the above copyright notice,\n+// this list of conditions and the following disclaimer.\n+// * Redistributions in binary form must reproduce the above copyright notice,\n+// this list of conditions and the following disclaimer in the documentation\n+// and/or other materials provided with the distribution.\n+// * Neither the name of Gabriel Gonzalez nor the names of other contributors\n+// may be used to endorse or promote products derived from this software\n+// without specific prior written permission.\n+//\n+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND\n+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n+// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR\n+// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n+// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n+// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n+// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n+// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+//\n+\n+// MARK: - Introduction\n+\n+//: The `Aquifer` library decouples stream processing stages from each other so\n+//: that you can mix and match diverse stages to produce useful streaming\n+//: programs.  If you are a library writer, `Aquifer` lets you package up\n+//: streaming components into a reusable interface.  If you are an application\n+//: writer, `Aquifer` lets you connect pre-made streaming components with minimal\n+//: effort to produce a highly declarative program.\n+//:\n+//: To enforce loose coupling, components can only communicate using two\n+//: commands:\n+//:\n+//: * `yield`: Send output data\n+//:\n+//: * `await`: Receive input data\n+//:\n+//: `Aquifer` has four types of components built around these two commands:\n+//:\n+//: * `Producer`s can only `yield` values and they model streaming sources\n+//:\n+//: * `Consumer`s can only `await` values and they model streaming sinks\n+//:\n+//: * `Pipe`s can both `yield` and `await` values and they model stream\n+//: transformations\n+//:\n+//: * `Effect`s can neither `yield` nor `await` and they model non-streaming\n+//: components\n+//:\n+//: You can connect these components together in four separate ways which\n+//: parallel the four above types:\n+//:\n+//: * `for_` handles `yield`s\n+//:\n+//: * `>~` handles `await`s\n+//:\n+//: * `>->` handles both `yield`s and `await`s\n+//:\n+//: * `>>-` handles return values\n+//:\n+//: As you connect components their types will change to reflect inputs and\n+//: outputs that you`ve fused away.  You know that you`re done connecting things\n+//: when you get an `Effect`, meaning that you have handled all inputs and\n+//: outputs.  You run this final `Effect` to begin streaming.\n+\n+import func Swiftz.const\n+import func Swiftz.curry\n+import func Swiftz.<|\n+import Aquifer\n+\n+// MARK: - Producers\n+\n+//: `Producer`s are effectful streams of input.  Specifically, a `Producer` is a\n+//: Type that extends any other type with a new `yield` command. This `yield` \n+//: command lets you send output downstream to an anonymous handler, decoupling\n+//: how you generate values from how you consume them.\n+\n+//: As an aside: Swift does not *technically* allow for the definition of polymorphic","path":"Tutorial.playground/Contents.swift","position":83,"original_position":83,"commit_id":"e77b92ba288195946fc52ff240d0708969bf5851","original_commit_id":"8ba4facd258c4e9c01e32fbb8e2a84c20a27ea69","user":{"login":"CodaFi","id":1896383,"avatar_url":"https://avatars.githubusercontent.com/u/1896383?v=3","gravatar_id":"","url":"https://api.github.com/users/CodaFi","html_url":"https://github.com/CodaFi","followers_url":"https://api.github.com/users/CodaFi/followers","following_url":"https://api.github.com/users/CodaFi/following{/other_user}","gists_url":"https://api.github.com/users/CodaFi/gists{/gist_id}","starred_url":"https://api.github.com/users/CodaFi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodaFi/subscriptions","organizations_url":"https://api.github.com/users/CodaFi/orgs","repos_url":"https://api.github.com/users/CodaFi/repos","events_url":"https://api.github.com/users/CodaFi/events{/privacy}","received_events_url":"https://api.github.com/users/CodaFi/received_events","type":"User","site_admin":false},"body":"Looks like we can only emphasize.  It may be possible to just stick this at the bottom and link to it.","created_at":"2015-08-28T01:45:55Z","updated_at":"2015-08-28T01:45:55Z","html_url":"https://github.com/typelift/Aquifer/pull/12#discussion_r38165207","pull_request_url":"https://api.github.com/repos/typelift/Aquifer/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/typelift/Aquifer/pulls/comments/38165207"},"html":{"href":"https://github.com/typelift/Aquifer/pull/12#discussion_r38165207"},"pull_request":{"href":"https://api.github.com/repos/typelift/Aquifer/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/typelift/Aquifer/pulls/12","id":43129421,"html_url":"https://github.com/typelift/Aquifer/pull/12","diff_url":"https://github.com/typelift/Aquifer/pull/12.diff","patch_url":"https://github.com/typelift/Aquifer/pull/12.patch","issue_url":"https://api.github.com/repos/typelift/Aquifer/issues/12","number":12,"state":"open","locked":false,"title":"[WIP] Tutorial!","user":{"login":"CodaFi","id":1896383,"avatar_url":"https://avatars.githubusercontent.com/u/1896383?v=3","gravatar_id":"","url":"https://api.github.com/users/CodaFi","html_url":"https://github.com/CodaFi","followers_url":"https://api.github.com/users/CodaFi/followers","following_url":"https://api.github.com/users/CodaFi/following{/other_user}","gists_url":"https://api.github.com/users/CodaFi/gists{/gist_id}","starred_url":"https://api.github.com/users/CodaFi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodaFi/subscriptions","organizations_url":"https://api.github.com/users/CodaFi/orgs","repos_url":"https://api.github.com/users/CodaFi/repos","events_url":"https://api.github.com/users/CodaFi/events{/privacy}","received_events_url":"https://api.github.com/users/CodaFi/received_events","type":"User","site_admin":false},"body":"Fixes #3 \r\n\r\nI'm doing this in parts here so we can edit them together before the big final merge.","created_at":"2015-08-23T21:54:11Z","updated_at":"2015-08-28T01:45:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9f39144d2bbee00f991378ad20ccfa0e8d1c6543","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/typelift/Aquifer/pulls/12/commits","review_comments_url":"https://api.github.com/repos/typelift/Aquifer/pulls/12/comments","review_comment_url":"https://api.github.com/repos/typelift/Aquifer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/typelift/Aquifer/issues/12/comments","statuses_url":"https://api.github.com/repos/typelift/Aquifer/statuses/e77b92ba288195946fc52ff240d0708969bf5851","head":{"label":"CodaFi:tutor-the-masses","ref":"tutor-the-masses","sha":"e77b92ba288195946fc52ff240d0708969bf5851","user":{"login":"CodaFi","id":1896383,"avatar_url":"https://avatars.githubusercontent.com/u/1896383?v=3","gravatar_id":"","url":"https://api.github.com/users/CodaFi","html_url":"https://github.com/CodaFi","followers_url":"https://api.github.com/users/CodaFi/followers","following_url":"https://api.github.com/users/CodaFi/following{/other_user}","gists_url":"https://api.github.com/users/CodaFi/gists{/gist_id}","starred_url":"https://api.github.com/users/CodaFi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodaFi/subscriptions","organizations_url":"https://api.github.com/users/CodaFi/orgs","repos_url":"https://api.github.com/users/CodaFi/repos","events_url":"https://api.github.com/users/CodaFi/events{/privacy}","received_events_url":"https://api.github.com/users/CodaFi/received_events","type":"User","site_admin":false},"repo":{"id":40742802,"name":"Aquifer","full_name":"CodaFi/Aquifer","owner":{"login":"CodaFi","id":1896383,"avatar_url":"https://avatars.githubusercontent.com/u/1896383?v=3","gravatar_id":"","url":"https://api.github.com/users/CodaFi","html_url":"https://github.com/CodaFi","followers_url":"https://api.github.com/users/CodaFi/followers","following_url":"https://api.github.com/users/CodaFi/following{/other_user}","gists_url":"https://api.github.com/users/CodaFi/gists{/gist_id}","starred_url":"https://api.github.com/users/CodaFi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CodaFi/subscriptions","organizations_url":"https://api.github.com/users/CodaFi/orgs","repos_url":"https://api.github.com/users/CodaFi/repos","events_url":"https://api.github.com/users/CodaFi/events{/privacy}","received_events_url":"https://api.github.com/users/CodaFi/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CodaFi/Aquifer","description":"Functional streaming abstractions in Swift","fork":true,"url":"https://api.github.com/repos/CodaFi/Aquifer","forks_url":"https://api.github.com/repos/CodaFi/Aquifer/forks","keys_url":"https://api.github.com/repos/CodaFi/Aquifer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CodaFi/Aquifer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CodaFi/Aquifer/teams","hooks_url":"https://api.github.com/repos/CodaFi/Aquifer/hooks","issue_events_url":"https://api.github.com/repos/CodaFi/Aquifer/issues/events{/number}","events_url":"https://api.github.com/repos/CodaFi/Aquifer/events","assignees_url":"https://api.github.com/repos/CodaFi/Aquifer/assignees{/user}","branches_url":"https://api.github.com/repos/CodaFi/Aquifer/branches{/branch}","tags_url":"https://api.github.com/repos/CodaFi/Aquifer/tags","blobs_url":"https://api.github.com/repos/CodaFi/Aquifer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CodaFi/Aquifer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CodaFi/Aquifer/git/refs{/sha}","trees_url":"https://api.github.com/repos/CodaFi/Aquifer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CodaFi/Aquifer/statuses/{sha}","languages_url":"https://api.github.com/repos/CodaFi/Aquifer/languages","stargazers_url":"https://api.github.com/repos/CodaFi/Aquifer/stargazers","contributors_url":"https://api.github.com/repos/CodaFi/Aquifer/contributors","subscribers_url":"https://api.github.com/repos/CodaFi/Aquifer/subscribers","subscription_url":"https://api.github.com/repos/CodaFi/Aquifer/subscription","commits_url":"https://api.github.com/repos/CodaFi/Aquifer/commits{/sha}","git_commits_url":"https://api.github.com/repos/CodaFi/Aquifer/git/commits{/sha}","comments_url":"https://api.github.com/repos/CodaFi/Aquifer/comments{/number}","issue_comment_url":"https://api.github.com/repos/CodaFi/Aquifer/issues/comments{/number}","contents_url":"https://api.github.com/repos/CodaFi/Aquifer/contents/{+path}","compare_url":"https://api.github.com/repos/CodaFi/Aquifer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CodaFi/Aquifer/merges","archive_url":"https://api.github.com/repos/CodaFi/Aquifer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CodaFi/Aquifer/downloads","issues_url":"https://api.github.com/repos/CodaFi/Aquifer/issues{/number}","pulls_url":"https://api.github.com/repos/CodaFi/Aquifer/pulls{/number}","milestones_url":"https://api.github.com/repos/CodaFi/Aquifer/milestones{/number}","notifications_url":"https://api.github.com/repos/CodaFi/Aquifer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CodaFi/Aquifer/labels{/name}","releases_url":"https://api.github.com/repos/CodaFi/Aquifer/releases{/id}","created_at":"2015-08-15T01:40:31Z","updated_at":"2015-08-15T02:35:59Z","pushed_at":"2015-08-28T01:45:11Z","git_url":"git://github.com/CodaFi/Aquifer.git","ssh_url":"git@github.com:CodaFi/Aquifer.git","clone_url":"https://github.com/CodaFi/Aquifer.git","svn_url":"https://github.com/CodaFi/Aquifer","homepage":null,"size":291,"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":"typelift:swift-develop","ref":"swift-develop","sha":"c3b18012f362f00197736f6065d43d701ff0da52","user":{"login":"typelift","id":8847821,"avatar_url":"https://avatars.githubusercontent.com/u/8847821?v=3","gravatar_id":"","url":"https://api.github.com/users/typelift","html_url":"https://github.com/typelift","followers_url":"https://api.github.com/users/typelift/followers","following_url":"https://api.github.com/users/typelift/following{/other_user}","gists_url":"https://api.github.com/users/typelift/gists{/gist_id}","starred_url":"https://api.github.com/users/typelift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typelift/subscriptions","organizations_url":"https://api.github.com/users/typelift/orgs","repos_url":"https://api.github.com/users/typelift/repos","events_url":"https://api.github.com/users/typelift/events{/privacy}","received_events_url":"https://api.github.com/users/typelift/received_events","type":"Organization","site_admin":false},"repo":{"id":29221538,"name":"Aquifer","full_name":"typelift/Aquifer","owner":{"login":"typelift","id":8847821,"avatar_url":"https://avatars.githubusercontent.com/u/8847821?v=3","gravatar_id":"","url":"https://api.github.com/users/typelift","html_url":"https://github.com/typelift","followers_url":"https://api.github.com/users/typelift/followers","following_url":"https://api.github.com/users/typelift/following{/other_user}","gists_url":"https://api.github.com/users/typelift/gists{/gist_id}","starred_url":"https://api.github.com/users/typelift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typelift/subscriptions","organizations_url":"https://api.github.com/users/typelift/orgs","repos_url":"https://api.github.com/users/typelift/repos","events_url":"https://api.github.com/users/typelift/events{/privacy}","received_events_url":"https://api.github.com/users/typelift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/typelift/Aquifer","description":"Functional streaming abstractions in Swift","fork":false,"url":"https://api.github.com/repos/typelift/Aquifer","forks_url":"https://api.github.com/repos/typelift/Aquifer/forks","keys_url":"https://api.github.com/repos/typelift/Aquifer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typelift/Aquifer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typelift/Aquifer/teams","hooks_url":"https://api.github.com/repos/typelift/Aquifer/hooks","issue_events_url":"https://api.github.com/repos/typelift/Aquifer/issues/events{/number}","events_url":"https://api.github.com/repos/typelift/Aquifer/events","assignees_url":"https://api.github.com/repos/typelift/Aquifer/assignees{/user}","branches_url":"https://api.github.com/repos/typelift/Aquifer/branches{/branch}","tags_url":"https://api.github.com/repos/typelift/Aquifer/tags","blobs_url":"https://api.github.com/repos/typelift/Aquifer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typelift/Aquifer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typelift/Aquifer/git/refs{/sha}","trees_url":"https://api.github.com/repos/typelift/Aquifer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typelift/Aquifer/statuses/{sha}","languages_url":"https://api.github.com/repos/typelift/Aquifer/languages","stargazers_url":"https://api.github.com/repos/typelift/Aquifer/stargazers","contributors_url":"https://api.github.com/repos/typelift/Aquifer/contributors","subscribers_url":"https://api.github.com/repos/typelift/Aquifer/subscribers","subscription_url":"https://api.github.com/repos/typelift/Aquifer/subscription","commits_url":"https://api.github.com/repos/typelift/Aquifer/commits{/sha}","git_commits_url":"https://api.github.com/repos/typelift/Aquifer/git/commits{/sha}","comments_url":"https://api.github.com/repos/typelift/Aquifer/comments{/number}","issue_comment_url":"https://api.github.com/repos/typelift/Aquifer/issues/comments{/number}","contents_url":"https://api.github.com/repos/typelift/Aquifer/contents/{+path}","compare_url":"https://api.github.com/repos/typelift/Aquifer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typelift/Aquifer/merges","archive_url":"https://api.github.com/repos/typelift/Aquifer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typelift/Aquifer/downloads","issues_url":"https://api.github.com/repos/typelift/Aquifer/issues{/number}","pulls_url":"https://api.github.com/repos/typelift/Aquifer/pulls{/number}","milestones_url":"https://api.github.com/repos/typelift/Aquifer/milestones{/number}","notifications_url":"https://api.github.com/repos/typelift/Aquifer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typelift/Aquifer/labels{/name}","releases_url":"https://api.github.com/repos/typelift/Aquifer/releases{/id}","created_at":"2015-01-14T01:44:28Z","updated_at":"2015-08-18T05:13:44Z","pushed_at":"2015-08-28T01:45:11Z","git_url":"git://github.com/typelift/Aquifer.git","ssh_url":"git@github.com:typelift/Aquifer.git","clone_url":"https://github.com/typelift/Aquifer.git","svn_url":"https://github.com/typelift/Aquifer","homepage":null,"size":1363,"stargazers_count":14,"watchers_count":14,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":7,"forks":1,"open_issues":7,"watchers":14,"default_branch":"swift-develop"}},"_links":{"self":{"href":"https://api.github.com/repos/typelift/Aquifer/pulls/12"},"html":{"href":"https://github.com/typelift/Aquifer/pull/12"},"issue":{"href":"https://api.github.com/repos/typelift/Aquifer/issues/12"},"comments":{"href":"https://api.github.com/repos/typelift/Aquifer/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/typelift/Aquifer/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/typelift/Aquifer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/typelift/Aquifer/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/typelift/Aquifer/statuses/e77b92ba288195946fc52ff240d0708969bf5851"}}}}