{"action":"created","comment":{"url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/comments/31987045","id":31987045,"diff_hunk":"@@ -1192,20 +1208,60 @@ capturedStatement output stmt = do\n \n   liftIO $ forkIO loop\n \n-  result <- gfinally (goStmt stmt) $ do\n-              -- Execution is done.\n-              liftIO $ modifyMVar_ completed (const $ return True)\n+  let finalize cmd = gfinally cmd $ do\n+        -- Execution is done.\n+        liftIO $ modifyMVar_ completed (const $ return True)\n+\n+        -- Finalize evaluation context.\n+        void $ forM postStmts goStmt\n \n-              -- Finalize evaluation context.\n-              void $ forM postStmts goStmt\n+        -- Once context is finalized, reading can finish. Wait for reading to finish to that the output\n+        -- accumulator is completely filled.\n+        liftIO $ takeMVar finishedReading\n \n-              -- Once context is finalized, reading can finish. Wait for reading to finish to that the output\n-              -- accumulator is completely filled.\n-              liftIO $ takeMVar finishedReading\n+  -- stderr -> console, stdout -> notebook\n+  log \"Before\"","path":"src/IHaskell/Eval/Evaluate.hs","position":106,"original_position":106,"commit_id":"e2aa68b27be3e7f3bdf9f00e5dbdac8a63804742","original_commit_id":"e2aa68b27be3e7f3bdf9f00e5dbdac8a63804742","user":{"login":"sumitsahrawat","id":5645741,"avatar_url":"https://avatars.githubusercontent.com/u/5645741?v=3","gravatar_id":"","url":"https://api.github.com/users/sumitsahrawat","html_url":"https://github.com/sumitsahrawat","followers_url":"https://api.github.com/users/sumitsahrawat/followers","following_url":"https://api.github.com/users/sumitsahrawat/following{/other_user}","gists_url":"https://api.github.com/users/sumitsahrawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sumitsahrawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumitsahrawat/subscriptions","organizations_url":"https://api.github.com/users/sumitsahrawat/orgs","repos_url":"https://api.github.com/users/sumitsahrawat/repos","events_url":"https://api.github.com/users/sumitsahrawat/events{/privacy}","received_events_url":"https://api.github.com/users/sumitsahrawat/received_events","type":"User","site_admin":false},"body":"@gibiansky This one does reach the notebook. There is some dark magic going on here.","created_at":"2015-06-09T07:07:56Z","updated_at":"2015-06-09T07:07:56Z","html_url":"https://github.com/sumitsahrawat/IHaskell/pull/1#discussion_r31987045","pull_request_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/comments/31987045"},"html":{"href":"https://github.com/sumitsahrawat/IHaskell/pull/1#discussion_r31987045"},"pull_request":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1","id":37094543,"html_url":"https://github.com/sumitsahrawat/IHaskell/pull/1","diff_url":"https://github.com/sumitsahrawat/IHaskell/pull/1.diff","patch_url":"https://github.com/sumitsahrawat/IHaskell/pull/1.patch","issue_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/1","number":1,"state":"open","locked":false,"title":"Generalize capturedStatement to capturedEval","user":{"login":"sumitsahrawat","id":5645741,"avatar_url":"https://avatars.githubusercontent.com/u/5645741?v=3","gravatar_id":"","url":"https://api.github.com/users/sumitsahrawat","html_url":"https://github.com/sumitsahrawat","followers_url":"https://api.github.com/users/sumitsahrawat/followers","following_url":"https://api.github.com/users/sumitsahrawat/following{/other_user}","gists_url":"https://api.github.com/users/sumitsahrawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sumitsahrawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumitsahrawat/subscriptions","organizations_url":"https://api.github.com/users/sumitsahrawat/orgs","repos_url":"https://api.github.com/users/sumitsahrawat/repos","events_url":"https://api.github.com/users/sumitsahrawat/events{/privacy}","received_events_url":"https://api.github.com/users/sumitsahrawat/received_events","type":"User","site_admin":false},"body":"Doesn't work yet, sadly.\r\nThere is a ton of code-duplication, to be dealt with later.\r\n\r\n---\r\n\r\n@gibiansky Does this look like a resonable approach? I really wanted to have a function along the lines of `wrapIO`, but getting it to work will take some time.","created_at":"2015-06-06T18:21:15Z","updated_at":"2015-06-09T07:07:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fb992d214bda6f29435998fe4c1ec6861fcc33a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1/commits","review_comments_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1/comments","review_comment_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/1/comments","statuses_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/statuses/e2aa68b27be3e7f3bdf9f00e5dbdac8a63804742","head":{"label":"sumitsahrawat:wrapIO","ref":"wrapIO","sha":"e2aa68b27be3e7f3bdf9f00e5dbdac8a63804742","user":{"login":"sumitsahrawat","id":5645741,"avatar_url":"https://avatars.githubusercontent.com/u/5645741?v=3","gravatar_id":"","url":"https://api.github.com/users/sumitsahrawat","html_url":"https://github.com/sumitsahrawat","followers_url":"https://api.github.com/users/sumitsahrawat/followers","following_url":"https://api.github.com/users/sumitsahrawat/following{/other_user}","gists_url":"https://api.github.com/users/sumitsahrawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sumitsahrawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumitsahrawat/subscriptions","organizations_url":"https://api.github.com/users/sumitsahrawat/orgs","repos_url":"https://api.github.com/users/sumitsahrawat/repos","events_url":"https://api.github.com/users/sumitsahrawat/events{/privacy}","received_events_url":"https://api.github.com/users/sumitsahrawat/received_events","type":"User","site_admin":false},"repo":{"id":32586764,"name":"IHaskell","full_name":"sumitsahrawat/IHaskell","owner":{"login":"sumitsahrawat","id":5645741,"avatar_url":"https://avatars.githubusercontent.com/u/5645741?v=3","gravatar_id":"","url":"https://api.github.com/users/sumitsahrawat","html_url":"https://github.com/sumitsahrawat","followers_url":"https://api.github.com/users/sumitsahrawat/followers","following_url":"https://api.github.com/users/sumitsahrawat/following{/other_user}","gists_url":"https://api.github.com/users/sumitsahrawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sumitsahrawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumitsahrawat/subscriptions","organizations_url":"https://api.github.com/users/sumitsahrawat/orgs","repos_url":"https://api.github.com/users/sumitsahrawat/repos","events_url":"https://api.github.com/users/sumitsahrawat/events{/privacy}","received_events_url":"https://api.github.com/users/sumitsahrawat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sumitsahrawat/IHaskell","description":"A Haskell kernel for IPython.","fork":true,"url":"https://api.github.com/repos/sumitsahrawat/IHaskell","forks_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/forks","keys_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/teams","hooks_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/hooks","issue_events_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/events{/number}","events_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/events","assignees_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/assignees{/user}","branches_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/branches{/branch}","tags_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/tags","blobs_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/refs{/sha}","trees_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/statuses/{sha}","languages_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/languages","stargazers_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/stargazers","contributors_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/contributors","subscribers_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/subscribers","subscription_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/subscription","commits_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/commits{/sha}","git_commits_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/commits{/sha}","comments_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/comments{/number}","issue_comment_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/comments{/number}","contents_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/contents/{+path}","compare_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/merges","archive_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/downloads","issues_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues{/number}","pulls_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls{/number}","milestones_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/milestones{/number}","notifications_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/labels{/name}","releases_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/releases{/id}","created_at":"2015-03-20T13:58:00Z","updated_at":"2015-04-29T18:18:35Z","pushed_at":"2015-06-07T22:35:19Z","git_url":"git://github.com/sumitsahrawat/IHaskell.git","ssh_url":"git@github.com:sumitsahrawat/IHaskell.git","clone_url":"https://github.com/sumitsahrawat/IHaskell.git","svn_url":"https://github.com/sumitsahrawat/IHaskell","homepage":null,"size":4573,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"sumitsahrawat:widgets","ref":"widgets","sha":"b1efbc1c39296b9d798be75b6c512c23a86c170e","user":{"login":"sumitsahrawat","id":5645741,"avatar_url":"https://avatars.githubusercontent.com/u/5645741?v=3","gravatar_id":"","url":"https://api.github.com/users/sumitsahrawat","html_url":"https://github.com/sumitsahrawat","followers_url":"https://api.github.com/users/sumitsahrawat/followers","following_url":"https://api.github.com/users/sumitsahrawat/following{/other_user}","gists_url":"https://api.github.com/users/sumitsahrawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sumitsahrawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumitsahrawat/subscriptions","organizations_url":"https://api.github.com/users/sumitsahrawat/orgs","repos_url":"https://api.github.com/users/sumitsahrawat/repos","events_url":"https://api.github.com/users/sumitsahrawat/events{/privacy}","received_events_url":"https://api.github.com/users/sumitsahrawat/received_events","type":"User","site_admin":false},"repo":{"id":32586764,"name":"IHaskell","full_name":"sumitsahrawat/IHaskell","owner":{"login":"sumitsahrawat","id":5645741,"avatar_url":"https://avatars.githubusercontent.com/u/5645741?v=3","gravatar_id":"","url":"https://api.github.com/users/sumitsahrawat","html_url":"https://github.com/sumitsahrawat","followers_url":"https://api.github.com/users/sumitsahrawat/followers","following_url":"https://api.github.com/users/sumitsahrawat/following{/other_user}","gists_url":"https://api.github.com/users/sumitsahrawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sumitsahrawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sumitsahrawat/subscriptions","organizations_url":"https://api.github.com/users/sumitsahrawat/orgs","repos_url":"https://api.github.com/users/sumitsahrawat/repos","events_url":"https://api.github.com/users/sumitsahrawat/events{/privacy}","received_events_url":"https://api.github.com/users/sumitsahrawat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sumitsahrawat/IHaskell","description":"A Haskell kernel for IPython.","fork":true,"url":"https://api.github.com/repos/sumitsahrawat/IHaskell","forks_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/forks","keys_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/teams","hooks_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/hooks","issue_events_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/events{/number}","events_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/events","assignees_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/assignees{/user}","branches_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/branches{/branch}","tags_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/tags","blobs_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/refs{/sha}","trees_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/statuses/{sha}","languages_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/languages","stargazers_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/stargazers","contributors_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/contributors","subscribers_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/subscribers","subscription_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/subscription","commits_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/commits{/sha}","git_commits_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/git/commits{/sha}","comments_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/comments{/number}","issue_comment_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/comments{/number}","contents_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/contents/{+path}","compare_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/merges","archive_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/downloads","issues_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues{/number}","pulls_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls{/number}","milestones_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/milestones{/number}","notifications_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/labels{/name}","releases_url":"https://api.github.com/repos/sumitsahrawat/IHaskell/releases{/id}","created_at":"2015-03-20T13:58:00Z","updated_at":"2015-04-29T18:18:35Z","pushed_at":"2015-06-07T22:35:19Z","git_url":"git://github.com/sumitsahrawat/IHaskell.git","ssh_url":"git@github.com:sumitsahrawat/IHaskell.git","clone_url":"https://github.com/sumitsahrawat/IHaskell.git","svn_url":"https://github.com/sumitsahrawat/IHaskell","homepage":null,"size":4573,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1"},"html":{"href":"https://github.com/sumitsahrawat/IHaskell/pull/1"},"issue":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/1"},"comments":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/sumitsahrawat/IHaskell/statuses/e2aa68b27be3e7f3bdf9f00e5dbdac8a63804742"}}}}