{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/1955","repository_url":"https://api.github.com/repos/ocaml/ocaml","labels_url":"https://api.github.com/repos/ocaml/ocaml/issues/1955/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/1955/comments","events_url":"https://api.github.com/repos/ocaml/ocaml/issues/1955/events","html_url":"https://github.com/ocaml/ocaml/pull/1955","id":346671126,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA1NDc5ODMz","number":1955,"title":"WIP: Add match operators","user":{"login":"lpw25","id":2631210,"node_id":"MDQ6VXNlcjI2MzEyMTA=","avatar_url":"https://avatars2.githubusercontent.com/u/2631210?v=4","gravatar_id":"","url":"https://api.github.com/users/lpw25","html_url":"https://github.com/lpw25","followers_url":"https://api.github.com/users/lpw25/followers","following_url":"https://api.github.com/users/lpw25/following{/other_user}","gists_url":"https://api.github.com/users/lpw25/gists{/gist_id}","starred_url":"https://api.github.com/users/lpw25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lpw25/subscriptions","organizations_url":"https://api.github.com/users/lpw25/orgs","repos_url":"https://api.github.com/users/lpw25/repos","events_url":"https://api.github.com/users/lpw25/events{/privacy}","received_events_url":"https://api.github.com/users/lpw25/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-01T16:19:23Z","updated_at":"2018-08-01T17:39:49Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/1955","html_url":"https://github.com/ocaml/ocaml/pull/1955","diff_url":"https://github.com/ocaml/ocaml/pull/1955.diff","patch_url":"https://github.com/ocaml/ocaml/pull/1955.patch"},"body":"This PR is the \"match operators\" part of #1947. I've extracted it to allow this part to be discussed independently of the rest of that PR. I've copied the description of this aspect below.\r\n\r\n-----------------\r\n\r\nThis PR also adds support for match operators. These are simpler than let operators because there is no match ... and ... construct. The translation for these is simply:\r\n\r\nmatch+ expr with\r\n| pat1 -> case1\r\n| pat2 -> case2\r\nto:\r\n\r\n(match+) (function | pat1 -> case1 | pat2 -> case2) expr\r\nAs with let I would recommend that a monad bind match+ to map and match* to bind."},"comment":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/comments/409659429","html_url":"https://github.com/ocaml/ocaml/pull/1955#issuecomment-409659429","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/1955","id":409659429,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTY1OTQyOQ==","user":{"login":"hhugo","id":835209,"node_id":"MDQ6VXNlcjgzNTIwOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/835209?v=4","gravatar_id":"","url":"https://api.github.com/users/hhugo","html_url":"https://github.com/hhugo","followers_url":"https://api.github.com/users/hhugo/followers","following_url":"https://api.github.com/users/hhugo/following{/other_user}","gists_url":"https://api.github.com/users/hhugo/gists{/gist_id}","starred_url":"https://api.github.com/users/hhugo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hhugo/subscriptions","organizations_url":"https://api.github.com/users/hhugo/orgs","repos_url":"https://api.github.com/users/hhugo/repos","events_url":"https://api.github.com/users/hhugo/events{/privacy}","received_events_url":"https://api.github.com/users/hhugo/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T17:39:49Z","updated_at":"2018-08-01T17:39:49Z","author_association":"CONTRIBUTOR","body":"@hcarty, we'll probably have to disallow exception under or patterns such as\r\n```\r\nmatch+ expr with\r\n| None | exception Not_found -> case 1\r\n| Some _ -> case2\r\n```  "}}
{"actor":{"display_login":"hhugo"}}