{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/284","labels_url":"https://api.github.com/repos/ocaml/ocaml/issues/284/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/ocaml/issues/284/comments","events_url":"https://api.github.com/repos/ocaml/ocaml/issues/284/events","html_url":"https://github.com/ocaml/ocaml/pull/284","id":115889794,"number":284,"title":"Allow to manipulate the argument of an n-ary constructor as a tuple","user":{"login":"alainfrisch","id":3305274,"avatar_url":"https://avatars.githubusercontent.com/u/3305274?v=3","gravatar_id":"","url":"https://api.github.com/users/alainfrisch","html_url":"https://github.com/alainfrisch","followers_url":"https://api.github.com/users/alainfrisch/followers","following_url":"https://api.github.com/users/alainfrisch/following{/other_user}","gists_url":"https://api.github.com/users/alainfrisch/gists{/gist_id}","starred_url":"https://api.github.com/users/alainfrisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alainfrisch/subscriptions","organizations_url":"https://api.github.com/users/alainfrisch/orgs","repos_url":"https://api.github.com/users/alainfrisch/repos","events_url":"https://api.github.com/users/alainfrisch/events{/privacy}","received_events_url":"https://api.github.com/users/alainfrisch/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-11-09T14:40:45Z","updated_at":"2015-11-10T12:20:16Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ocaml/ocaml/pulls/284","html_url":"https://github.com/ocaml/ocaml/pull/284","diff_url":"https://github.com/ocaml/ocaml/pull/284.diff","patch_url":"https://github.com/ocaml/ocaml/pull/284.patch"},"body":"This PR implements Mantis' PR#6455 ( http://caml.inria.fr/mantis/view.php?id=6455 ), i.e. the ability to manipulate the argument of an n-ary constructor as a real tuple, constructing or deconstructing the tuple on demand.\r\n\r\n(It would be possible to use the tuple value in place of the constructor or vice-versa in patterns, when the constructor has tag 0.  This optimization is not included.)"},"comment":{"url":"https://api.github.com/repos/ocaml/ocaml/issues/comments/155406524","html_url":"https://github.com/ocaml/ocaml/pull/284#issuecomment-155406524","issue_url":"https://api.github.com/repos/ocaml/ocaml/issues/284","id":155406524,"user":{"login":"lpw25","id":2631210,"avatar_url":"https://avatars.githubusercontent.com/u/2631210?v=3","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},"created_at":"2015-11-10T12:20:16Z","updated_at":"2015-11-10T12:20:16Z","body":"> I am concerned by the fact that this patch makes pattern-matching allocate a data structure transparently.\r\n\r\nIt is unfortunate but it is no worse than other operations which hide allocation (I'm looking at you currying). At least in this case I would expect a future version compiler to be able to optimise this allocation away in many cases.\r\n\r\n> They will need a very good memory profiler :-)\r\n\r\nI think that it is reasonable to expect beginners to need a memory profiler to fully optimise their program's memory performance, and I would expect an expert to already know that this operation allocates."}}