{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/reason/issues/2140","repository_url":"https://api.github.com/repos/facebook/reason","labels_url":"https://api.github.com/repos/facebook/reason/issues/2140/labels{/name}","comments_url":"https://api.github.com/repos/facebook/reason/issues/2140/comments","events_url":"https://api.github.com/repos/facebook/reason/issues/2140/events","html_url":"https://github.com/facebook/reason/pull/2140","id":350320696,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA4MTk4NzYw","number":2140,"title":"Add `let.Foo` sugar for continuation-passing-style","user":{"login":"jaredly","id":112170,"node_id":"MDQ6VXNlcjExMjE3MA==","avatar_url":"https://avatars3.githubusercontent.com/u/112170?v=4","gravatar_id":"","url":"https://api.github.com/users/jaredly","html_url":"https://github.com/jaredly","followers_url":"https://api.github.com/users/jaredly/followers","following_url":"https://api.github.com/users/jaredly/following{/other_user}","gists_url":"https://api.github.com/users/jaredly/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredly/subscriptions","organizations_url":"https://api.github.com/users/jaredly/orgs","repos_url":"https://api.github.com/users/jaredly/repos","events_url":"https://api.github.com/users/jaredly/events{/privacy}","received_events_url":"https://api.github.com/users/jaredly/received_events","type":"User","site_admin":false},"labels":[{"id":287261905,"node_id":"MDU6TGFiZWwyODcyNjE5MDU=","url":"https://api.github.com/repos/facebook/reason/labels/CLA%20Signed","name":"CLA Signed","color":"38A869","default":false},{"id":796437733,"node_id":"MDU6TGFiZWw3OTY0Mzc3MzM=","url":"https://api.github.com/repos/facebook/reason/labels/cla%20signed","name":"cla signed","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":62,"created_at":"2018-08-14T08:01:32Z","updated_at":"2018-08-21T17:01:30Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/facebook/reason/pulls/2140","html_url":"https://github.com/facebook/reason/pull/2140","diff_url":"https://github.com/facebook/reason/pull/2140.diff","patch_url":"https://github.com/facebook/reason/pull/2140.patch"},"body":"This will allow us to get most of the benefits of lwt's ppx or ppx_let without baking in any specific implementation.\r\nHere's what it looks like to bind the \"option\" monad: (most recent syntax iteration, see bottom for original proposal)\r\n```\r\nmodule Opt = {\r\n  let let_ = Option.flatMap;\r\n  let and_ = Option.pair;\r\n};\r\n\r\nlet.Opt x = Some(10)\r\nand.Opt y = Some(20)\r\nand.Opt z = Some(30);\r\nSome(x * y + z);\r\n```\r\n\r\nI brought in some of the attribute handling changes in https://github.com/facebook/reason/pull/1826 -- I didn't want to change too much, but it does make handling attributes much nicer.\r\n\r\nReferences:\r\n- the OCaml issue detailing a similar approach https://github.com/ocaml/ocaml/pull/1947\r\n- the \"percent less\" PR that probably conflicts with this one https://github.com/facebook/reason/pull/1735\r\n\r\nthanks to @aantron for help with the implementation, and everyone who gave feedback & ideas on the concrete syntax.\r\n\r\n---\r\n\r\n### original proposed syntax\r\n\r\n```\r\nlet await = (value, continuation) => Js.Promise.then_(continuation, value);\r\n\r\nlet () = {\r\n  let!await name = getName();\r\n  let!await age = getAge(name);\r\n  Promise.resolve({name, age})\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/facebook/reason/issues/comments/414747504","html_url":"https://github.com/facebook/reason/pull/2140#issuecomment-414747504","issue_url":"https://api.github.com/repos/facebook/reason/issues/2140","id":414747504,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDc0NzUwNA==","user":{"login":"hcarty","id":199147,"node_id":"MDQ6VXNlcjE5OTE0Nw==","avatar_url":"https://avatars3.githubusercontent.com/u/199147?v=4","gravatar_id":"","url":"https://api.github.com/users/hcarty","html_url":"https://github.com/hcarty","followers_url":"https://api.github.com/users/hcarty/followers","following_url":"https://api.github.com/users/hcarty/following{/other_user}","gists_url":"https://api.github.com/users/hcarty/gists{/gist_id}","starred_url":"https://api.github.com/users/hcarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hcarty/subscriptions","organizations_url":"https://api.github.com/users/hcarty/orgs","repos_url":"https://api.github.com/users/hcarty/repos","events_url":"https://api.github.com/users/hcarty/events{/privacy}","received_events_url":"https://api.github.com/users/hcarty/received_events","type":"User","site_admin":false},"created_at":"2018-08-21T17:01:30Z","updated_at":"2018-08-21T17:01:30Z","author_association":"CONTRIBUTOR","body":"@jaredly Makes total sense.  Thanks, and thank you and @aantron for working on this feature!  It has the potential to be *really* nice."}}
{"actor":{"display_login":"hcarty"}}