{"action":"created","comment":{"url":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/comments/237216382","pull_request_review_id":179461798,"id":237216382,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzIxNjM4Mg==","diff_hunk":"@@ -0,0 +1,143 @@\n+package scalaz.zio.java;\n+\n+import scala.runtime.BoxedUnit;\n+import scalaz.zio.ExitResult;\n+import scalaz.zio.Fiber;\n+\n+import java.util.function.BiFunction;\n+import java.util.function.Function;\n+import java.util.function.Supplier;\n+\n+public class IO<E, A> {\n+\n+    private scalaz.zio.IO<E, A> delegate;\n+\n+    private IO(scalaz.zio.IO<E, A> delegate) {\n+        this.delegate = delegate;\n+    }\n+\n+    public <B> IO<E, B> map(Function<A, B> f) {\n+        return new IO<>(delegate.map(f::apply));\n+    }\n+\n+    public <E2, B> IO<E2, B> bimap(Function<E, E2> f, Function<A, B> g) {\n+        return new IO<>(delegate.bimap(f::apply, g::apply));\n+    }\n+\n+    public <E1 extends E, B> IO<E1, B> flatMap(Function<A, IO<E1, B>> f) {\n+        return new IO<>(delegate.flatMap(f.andThen(io -> io.delegate)::apply));\n+    }\n+\n+    // TODO do we want a separate java Fiber?\n+    public IO<Void, Fiber<E, A>> fork() {\n+        return new IO<>(delegate.fork()).leftMap(nothing -> null);\n+    }\n+\n+    public IO<Void, Fiber<E, A>> fork0(Function<ExitResult.Cause<Object>, IO<Void, Void>> f) {\n+        return new IO<>(\n+                delegate.fork0(f.andThen(io ->\n+                        io.delegate.<Object, BoxedUnit>bimap(\n+                                _void -> _void,\n+                                _void -> BoxedUnit.UNIT\n+                        ))::apply\n+                )\n+        ).bimap(nothing -> null, nothing -> null);\n+    }\n+\n+    public <E1 extends E, B, C> IO<E1, C> parWith(IO<E1, B> that, BiFunction<A, B, C> f) {\n+        return new IO<>(delegate.parWith(that.delegate, f::apply));\n+    }\n+\n+    public <E1 extends E, B> IO<E1, scala.Tuple2<A, B>> par(IO<E1, B> that) {\n+        return new IO<>(delegate.par(that.delegate));\n+    }\n+\n+    public IO<E, A> race(IO<E, A> that) {\n+        return new IO<>(delegate.race(that.delegate));\n+    }\n+\n+    // TODO should we use the Scala Either? Maybe create an Either for Java?\n+    public <B> IO<E, scala.util.Either<A, B>> raceBoth(IO<E, B> that) {","path":"interop-java/src/main/java/scalaz/zio/java/IO.java","position":60,"original_position":60,"commit_id":"1ae076c11342759af3a71496dbc923fc11b340cb","original_commit_id":"1ae076c11342759af3a71496dbc923fc11b340cb","user":{"login":"jdegoes","id":156745,"node_id":"MDQ6VXNlcjE1Njc0NQ==","avatar_url":"https://avatars1.githubusercontent.com/u/156745?v=4","gravatar_id":"","url":"https://api.github.com/users/jdegoes","html_url":"https://github.com/jdegoes","followers_url":"https://api.github.com/users/jdegoes/followers","following_url":"https://api.github.com/users/jdegoes/following{/other_user}","gists_url":"https://api.github.com/users/jdegoes/gists{/gist_id}","starred_url":"https://api.github.com/users/jdegoes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdegoes/subscriptions","organizations_url":"https://api.github.com/users/jdegoes/orgs","repos_url":"https://api.github.com/users/jdegoes/repos","events_url":"https://api.github.com/users/jdegoes/events{/privacy}","received_events_url":"https://api.github.com/users/jdegoes/received_events","type":"User","site_admin":false},"body":"We can use `Optional`, of course, instead of `scala.Option`.","created_at":"2018-11-28T18:55:26Z","updated_at":"2018-11-28T18:55:27Z","html_url":"https://github.com/scalaz/scalaz-zio/pull/383#discussion_r237216382","pull_request_url":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/comments/237216382"},"html":{"href":"https://github.com/scalaz/scalaz-zio/pull/383#discussion_r237216382"},"pull_request":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383"}},"in_reply_to_id":237216176},"pull_request":{"url":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383","id":233375118,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzMzc1MTE4","html_url":"https://github.com/scalaz/scalaz-zio/pull/383","diff_url":"https://github.com/scalaz/scalaz-zio/pull/383.diff","patch_url":"https://github.com/scalaz/scalaz-zio/pull/383.patch","issue_url":"https://api.github.com/repos/scalaz/scalaz-zio/issues/383","number":383,"state":"open","locked":false,"title":"Java Facade","user":{"login":"xplosunn","id":7125555,"node_id":"MDQ6VXNlcjcxMjU1NTU=","avatar_url":"https://avatars0.githubusercontent.com/u/7125555?v=4","gravatar_id":"","url":"https://api.github.com/users/xplosunn","html_url":"https://github.com/xplosunn","followers_url":"https://api.github.com/users/xplosunn/followers","following_url":"https://api.github.com/users/xplosunn/following{/other_user}","gists_url":"https://api.github.com/users/xplosunn/gists{/gist_id}","starred_url":"https://api.github.com/users/xplosunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xplosunn/subscriptions","organizations_url":"https://api.github.com/users/xplosunn/orgs","repos_url":"https://api.github.com/users/xplosunn/repos","events_url":"https://api.github.com/users/xplosunn/events{/privacy}","received_events_url":"https://api.github.com/users/xplosunn/received_events","type":"User","site_admin":false},"body":"Starter of a work in progress to solve #378 \r\n\r\nOpening the PR now just to know if this is the pattern the go for (zio's implementations encapsulated in java types).\r\n\r\nIf this is the way to go, I'll implement all the obvious stuff, add javadoc to everything and open up some other things for discussion.","created_at":"2018-11-25T13:20:17Z","updated_at":"2018-11-28T18:55:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c852996072f4699127c6af46e9e53185552cf172","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383/commits","review_comments_url":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383/comments","review_comment_url":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scalaz/scalaz-zio/issues/383/comments","statuses_url":"https://api.github.com/repos/scalaz/scalaz-zio/statuses/1ae076c11342759af3a71496dbc923fc11b340cb","head":{"label":"xplosunn:java","ref":"java","sha":"1ae076c11342759af3a71496dbc923fc11b340cb","user":{"login":"xplosunn","id":7125555,"node_id":"MDQ6VXNlcjcxMjU1NTU=","avatar_url":"https://avatars0.githubusercontent.com/u/7125555?v=4","gravatar_id":"","url":"https://api.github.com/users/xplosunn","html_url":"https://github.com/xplosunn","followers_url":"https://api.github.com/users/xplosunn/followers","following_url":"https://api.github.com/users/xplosunn/following{/other_user}","gists_url":"https://api.github.com/users/xplosunn/gists{/gist_id}","starred_url":"https://api.github.com/users/xplosunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xplosunn/subscriptions","organizations_url":"https://api.github.com/users/xplosunn/orgs","repos_url":"https://api.github.com/users/xplosunn/repos","events_url":"https://api.github.com/users/xplosunn/events{/privacy}","received_events_url":"https://api.github.com/users/xplosunn/received_events","type":"User","site_admin":false},"repo":{"id":151775039,"node_id":"MDEwOlJlcG9zaXRvcnkxNTE3NzUwMzk=","name":"scalaz-zio","full_name":"xplosunn/scalaz-zio","private":false,"owner":{"login":"xplosunn","id":7125555,"node_id":"MDQ6VXNlcjcxMjU1NTU=","avatar_url":"https://avatars0.githubusercontent.com/u/7125555?v=4","gravatar_id":"","url":"https://api.github.com/users/xplosunn","html_url":"https://github.com/xplosunn","followers_url":"https://api.github.com/users/xplosunn/followers","following_url":"https://api.github.com/users/xplosunn/following{/other_user}","gists_url":"https://api.github.com/users/xplosunn/gists{/gist_id}","starred_url":"https://api.github.com/users/xplosunn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xplosunn/subscriptions","organizations_url":"https://api.github.com/users/xplosunn/orgs","repos_url":"https://api.github.com/users/xplosunn/repos","events_url":"https://api.github.com/users/xplosunn/events{/privacy}","received_events_url":"https://api.github.com/users/xplosunn/received_events","type":"User","site_admin":false},"html_url":"https://github.com/xplosunn/scalaz-zio","description":"ZIO — A principled, powerful, standalone effect data type for any Scala project.","fork":true,"url":"https://api.github.com/repos/xplosunn/scalaz-zio","forks_url":"https://api.github.com/repos/xplosunn/scalaz-zio/forks","keys_url":"https://api.github.com/repos/xplosunn/scalaz-zio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/xplosunn/scalaz-zio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/xplosunn/scalaz-zio/teams","hooks_url":"https://api.github.com/repos/xplosunn/scalaz-zio/hooks","issue_events_url":"https://api.github.com/repos/xplosunn/scalaz-zio/issues/events{/number}","events_url":"https://api.github.com/repos/xplosunn/scalaz-zio/events","assignees_url":"https://api.github.com/repos/xplosunn/scalaz-zio/assignees{/user}","branches_url":"https://api.github.com/repos/xplosunn/scalaz-zio/branches{/branch}","tags_url":"https://api.github.com/repos/xplosunn/scalaz-zio/tags","blobs_url":"https://api.github.com/repos/xplosunn/scalaz-zio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/xplosunn/scalaz-zio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/xplosunn/scalaz-zio/git/refs{/sha}","trees_url":"https://api.github.com/repos/xplosunn/scalaz-zio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/xplosunn/scalaz-zio/statuses/{sha}","languages_url":"https://api.github.com/repos/xplosunn/scalaz-zio/languages","stargazers_url":"https://api.github.com/repos/xplosunn/scalaz-zio/stargazers","contributors_url":"https://api.github.com/repos/xplosunn/scalaz-zio/contributors","subscribers_url":"https://api.github.com/repos/xplosunn/scalaz-zio/subscribers","subscription_url":"https://api.github.com/repos/xplosunn/scalaz-zio/subscription","commits_url":"https://api.github.com/repos/xplosunn/scalaz-zio/commits{/sha}","git_commits_url":"https://api.github.com/repos/xplosunn/scalaz-zio/git/commits{/sha}","comments_url":"https://api.github.com/repos/xplosunn/scalaz-zio/comments{/number}","issue_comment_url":"https://api.github.com/repos/xplosunn/scalaz-zio/issues/comments{/number}","contents_url":"https://api.github.com/repos/xplosunn/scalaz-zio/contents/{+path}","compare_url":"https://api.github.com/repos/xplosunn/scalaz-zio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/xplosunn/scalaz-zio/merges","archive_url":"https://api.github.com/repos/xplosunn/scalaz-zio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/xplosunn/scalaz-zio/downloads","issues_url":"https://api.github.com/repos/xplosunn/scalaz-zio/issues{/number}","pulls_url":"https://api.github.com/repos/xplosunn/scalaz-zio/pulls{/number}","milestones_url":"https://api.github.com/repos/xplosunn/scalaz-zio/milestones{/number}","notifications_url":"https://api.github.com/repos/xplosunn/scalaz-zio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/xplosunn/scalaz-zio/labels{/name}","releases_url":"https://api.github.com/repos/xplosunn/scalaz-zio/releases{/id}","deployments_url":"https://api.github.com/repos/xplosunn/scalaz-zio/deployments","created_at":"2018-10-05T20:33:06Z","updated_at":"2018-10-05T20:33:08Z","pushed_at":"2018-11-28T00:18:24Z","git_url":"git://github.com/xplosunn/scalaz-zio.git","ssh_url":"git@github.com:xplosunn/scalaz-zio.git","clone_url":"https://github.com/xplosunn/scalaz-zio.git","svn_url":"https://github.com/xplosunn/scalaz-zio","homepage":"https://scalaz.github.io/scalaz-zio/","size":2789,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scalaz:master","ref":"master","sha":"9bc9e8a32916273bfe53c40b203a17f32f27ac6c","user":{"login":"scalaz","id":183416,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzQxNg==","avatar_url":"https://avatars0.githubusercontent.com/u/183416?v=4","gravatar_id":"","url":"https://api.github.com/users/scalaz","html_url":"https://github.com/scalaz","followers_url":"https://api.github.com/users/scalaz/followers","following_url":"https://api.github.com/users/scalaz/following{/other_user}","gists_url":"https://api.github.com/users/scalaz/gists{/gist_id}","starred_url":"https://api.github.com/users/scalaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalaz/subscriptions","organizations_url":"https://api.github.com/users/scalaz/orgs","repos_url":"https://api.github.com/users/scalaz/repos","events_url":"https://api.github.com/users/scalaz/events{/privacy}","received_events_url":"https://api.github.com/users/scalaz/received_events","type":"Organization","site_admin":false},"repo":{"id":134079884,"node_id":"MDEwOlJlcG9zaXRvcnkxMzQwNzk4ODQ=","name":"scalaz-zio","full_name":"scalaz/scalaz-zio","private":false,"owner":{"login":"scalaz","id":183416,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4MzQxNg==","avatar_url":"https://avatars0.githubusercontent.com/u/183416?v=4","gravatar_id":"","url":"https://api.github.com/users/scalaz","html_url":"https://github.com/scalaz","followers_url":"https://api.github.com/users/scalaz/followers","following_url":"https://api.github.com/users/scalaz/following{/other_user}","gists_url":"https://api.github.com/users/scalaz/gists{/gist_id}","starred_url":"https://api.github.com/users/scalaz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scalaz/subscriptions","organizations_url":"https://api.github.com/users/scalaz/orgs","repos_url":"https://api.github.com/users/scalaz/repos","events_url":"https://api.github.com/users/scalaz/events{/privacy}","received_events_url":"https://api.github.com/users/scalaz/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/scalaz/scalaz-zio","description":"ZIO — Type-safe, composable concurrency for Scala","fork":false,"url":"https://api.github.com/repos/scalaz/scalaz-zio","forks_url":"https://api.github.com/repos/scalaz/scalaz-zio/forks","keys_url":"https://api.github.com/repos/scalaz/scalaz-zio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scalaz/scalaz-zio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scalaz/scalaz-zio/teams","hooks_url":"https://api.github.com/repos/scalaz/scalaz-zio/hooks","issue_events_url":"https://api.github.com/repos/scalaz/scalaz-zio/issues/events{/number}","events_url":"https://api.github.com/repos/scalaz/scalaz-zio/events","assignees_url":"https://api.github.com/repos/scalaz/scalaz-zio/assignees{/user}","branches_url":"https://api.github.com/repos/scalaz/scalaz-zio/branches{/branch}","tags_url":"https://api.github.com/repos/scalaz/scalaz-zio/tags","blobs_url":"https://api.github.com/repos/scalaz/scalaz-zio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scalaz/scalaz-zio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scalaz/scalaz-zio/git/refs{/sha}","trees_url":"https://api.github.com/repos/scalaz/scalaz-zio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scalaz/scalaz-zio/statuses/{sha}","languages_url":"https://api.github.com/repos/scalaz/scalaz-zio/languages","stargazers_url":"https://api.github.com/repos/scalaz/scalaz-zio/stargazers","contributors_url":"https://api.github.com/repos/scalaz/scalaz-zio/contributors","subscribers_url":"https://api.github.com/repos/scalaz/scalaz-zio/subscribers","subscription_url":"https://api.github.com/repos/scalaz/scalaz-zio/subscription","commits_url":"https://api.github.com/repos/scalaz/scalaz-zio/commits{/sha}","git_commits_url":"https://api.github.com/repos/scalaz/scalaz-zio/git/commits{/sha}","comments_url":"https://api.github.com/repos/scalaz/scalaz-zio/comments{/number}","issue_comment_url":"https://api.github.com/repos/scalaz/scalaz-zio/issues/comments{/number}","contents_url":"https://api.github.com/repos/scalaz/scalaz-zio/contents/{+path}","compare_url":"https://api.github.com/repos/scalaz/scalaz-zio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scalaz/scalaz-zio/merges","archive_url":"https://api.github.com/repos/scalaz/scalaz-zio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scalaz/scalaz-zio/downloads","issues_url":"https://api.github.com/repos/scalaz/scalaz-zio/issues{/number}","pulls_url":"https://api.github.com/repos/scalaz/scalaz-zio/pulls{/number}","milestones_url":"https://api.github.com/repos/scalaz/scalaz-zio/milestones{/number}","notifications_url":"https://api.github.com/repos/scalaz/scalaz-zio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scalaz/scalaz-zio/labels{/name}","releases_url":"https://api.github.com/repos/scalaz/scalaz-zio/releases{/id}","deployments_url":"https://api.github.com/repos/scalaz/scalaz-zio/deployments","created_at":"2018-05-19T16:40:37Z","updated_at":"2018-11-28T18:53:08Z","pushed_at":"2018-11-28T18:30:34Z","git_url":"git://github.com/scalaz/scalaz-zio.git","ssh_url":"git@github.com:scalaz/scalaz-zio.git","clone_url":"https://github.com/scalaz/scalaz-zio.git","svn_url":"https://github.com/scalaz/scalaz-zio","homepage":"https://scalaz.github.io/scalaz-zio/","size":2861,"stargazers_count":422,"watchers_count":422,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":127,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":127,"open_issues":73,"watchers":422,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383"},"html":{"href":"https://github.com/scalaz/scalaz-zio/pull/383"},"issue":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/issues/383"},"comments":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/issues/383/comments"},"review_comments":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383/comments"},"review_comment":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/pulls/383/commits"},"statuses":{"href":"https://api.github.com/repos/scalaz/scalaz-zio/statuses/1ae076c11342759af3a71496dbc923fc11b340cb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"jdegoes"}}