{"action":"created","issue":{"url":"https://api.github.com/repos/polysemy-research/polysemy/issues/133","repository_url":"https://api.github.com/repos/polysemy-research/polysemy","labels_url":"https://api.github.com/repos/polysemy-research/polysemy/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/polysemy-research/polysemy/issues/133/comments","events_url":"https://api.github.com/repos/polysemy-research/polysemy/issues/133/events","html_url":"https://github.com/polysemy-research/polysemy/issues/133","id":461185750,"node_id":"MDU6SXNzdWU0NjExODU3NTA=","number":133,"title":"Bracket and intercept do not work together","user":{"login":"rtimush","id":831307,"node_id":"MDQ6VXNlcjgzMTMwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/831307?v=4","gravatar_id":"","url":"https://api.github.com/users/rtimush","html_url":"https://github.com/rtimush","followers_url":"https://api.github.com/users/rtimush/followers","following_url":"https://api.github.com/users/rtimush/following{/other_user}","gists_url":"https://api.github.com/users/rtimush/gists{/gist_id}","starred_url":"https://api.github.com/users/rtimush/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtimush/subscriptions","organizations_url":"https://api.github.com/users/rtimush/orgs","repos_url":"https://api.github.com/users/rtimush/repos","events_url":"https://api.github.com/users/rtimush/events{/privacy}","received_events_url":"https://api.github.com/users/rtimush/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2019-06-26T21:17:04Z","updated_at":"2019-06-26T23:38:59Z","closed_at":null,"author_association":"NONE","body":"It seems that effects decorated with an `intercept` combinator are ignored when called inside a bracket. For example, the following code prints\r\n```\r\nwriteTTY \"Without bracket\"\r\nWithout bracket\r\nWith bracket\r\n```\r\nalthough I expected to have a  `writeTTY \"With bracket\"` line as well.\r\n\r\n```haskell\r\nimport           Polysemy\r\nimport           Polysemy.Resource\r\n\r\ndata Teletype m a where\r\n    WriteTTY :: String -> Teletype m ()\r\n\r\nmakeSem ''Teletype\r\n\r\nrunTeletypeIO :: Member (Lift IO) r => Sem (Teletype ': r) a -> Sem r a\r\nrunTeletypeIO = interpret $ \\case\r\n    WriteTTY msg -> sendM $ putStrLn msg\r\n\r\nwithTeletypeLogging :: Members '[Teletype] r => Sem r a -> Sem r a\r\nwithTeletypeLogging = intercept $ \\case\r\n    WriteTTY msg -> do\r\n        writeTTY $ \"writeTTY \" <> show msg\r\n        writeTTY msg\r\n\r\nmain :: IO ()\r\nmain = (runM .@ runResourceInIO) . runTeletypeIO . withTeletypeLogging $ do\r\n    writeTTY \"Without bracket\"\r\n    bracket (return ()) return (const $ writeTTY \"With bracket\")\r\n```"},"comment":{"url":"https://api.github.com/repos/polysemy-research/polysemy/issues/comments/506082978","html_url":"https://github.com/polysemy-research/polysemy/issues/133#issuecomment-506082978","issue_url":"https://api.github.com/repos/polysemy-research/polysemy/issues/133","id":506082978,"node_id":"MDEyOklzc3VlQ29tbWVudDUwNjA4Mjk3OA==","user":{"login":"isovector","id":307223,"node_id":"MDQ6VXNlcjMwNzIyMw==","avatar_url":"https://avatars3.githubusercontent.com/u/307223?v=4","gravatar_id":"","url":"https://api.github.com/users/isovector","html_url":"https://github.com/isovector","followers_url":"https://api.github.com/users/isovector/followers","following_url":"https://api.github.com/users/isovector/following{/other_user}","gists_url":"https://api.github.com/users/isovector/gists{/gist_id}","starred_url":"https://api.github.com/users/isovector/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isovector/subscriptions","organizations_url":"https://api.github.com/users/isovector/orgs","repos_url":"https://api.github.com/users/isovector/repos","events_url":"https://api.github.com/users/isovector/events{/privacy}","received_events_url":"https://api.github.com/users/isovector/received_events","type":"User","site_admin":false},"created_at":"2019-06-26T23:38:59Z","updated_at":"2019-06-26T23:38:59Z","author_association":"COLLABORATOR","body":"That's slightly encouraging. I'm not sure what the heck is going on, but at least it's consistent with the rest of the semantics. Let me dig in."}}
{"actor":{"display_login":"isovector"}}