{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4144","repository_url":"https://api.github.com/repos/jashkenas/coffeescript","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4144/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4144/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4144/events","html_url":"https://github.com/jashkenas/coffeescript/pull/4144","id":116592923,"number":4144,"title":"Pipe Operator","user":{"login":"hzamani","id":397413,"avatar_url":"https://avatars.githubusercontent.com/u/397413?v=3","gravatar_id":"","url":"https://api.github.com/users/hzamani","html_url":"https://github.com/hzamani","followers_url":"https://api.github.com/users/hzamani/followers","following_url":"https://api.github.com/users/hzamani/following{/other_user}","gists_url":"https://api.github.com/users/hzamani/gists{/gist_id}","starred_url":"https://api.github.com/users/hzamani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hzamani/subscriptions","organizations_url":"https://api.github.com/users/hzamani/orgs","repos_url":"https://api.github.com/users/hzamani/repos","events_url":"https://api.github.com/users/hzamani/events{/privacy}","received_events_url":"https://api.github.com/users/hzamani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":45,"created_at":"2015-11-12T17:00:48Z","updated_at":"2016-09-28T12:31:26Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jashkenas/coffeescript/pulls/4144","html_url":"https://github.com/jashkenas/coffeescript/pull/4144","diff_url":"https://github.com/jashkenas/coffeescript/pull/4144.diff","patch_url":"https://github.com/jashkenas/coffeescript/pull/4144.patch"},"body":"Pipe operator `|>` adds its right hand expression as first argument to the left hand function invocation.\r\n\r\nSelecting first operand was a smart choice in Elixir as they don't have function currying. I think it's also a good choice for CoffeeScript, because of JS libraries common structure on accepting \"subject\" (i.e. `Object|Array|String|...`) as first arg.\r\n\r\nAn answer to #1339 and #3600\r\n\r\n```coffeescript\r\n_ = require 'lodash'\r\n\r\nusers = [\r\n  { user: 'barney',  active: false, age: 37}\r\n  { user: 'fred',    active: true,  age: 21}\r\n  { user: 'pebbles', active: true,  age: 19}\r\n]\r\n\r\nyoungest = users\r\n  |> _.select('active')\r\n  |> _.sortBy('age')\r\n  |> _.first\r\n  |> _.get('user')\r\n  |> _.capitalize\r\n\r\nconsole.log youngest\r\n```"},"comment":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/comments/250153116","html_url":"https://github.com/jashkenas/coffeescript/pull/4144#issuecomment-250153116","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4144","id":250153116,"user":{"login":"kirly-af","id":9356687,"avatar_url":"https://avatars.githubusercontent.com/u/9356687?v=3","gravatar_id":"","url":"https://api.github.com/users/kirly-af","html_url":"https://github.com/kirly-af","followers_url":"https://api.github.com/users/kirly-af/followers","following_url":"https://api.github.com/users/kirly-af/following{/other_user}","gists_url":"https://api.github.com/users/kirly-af/gists{/gist_id}","starred_url":"https://api.github.com/users/kirly-af/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kirly-af/subscriptions","organizations_url":"https://api.github.com/users/kirly-af/orgs","repos_url":"https://api.github.com/users/kirly-af/repos","events_url":"https://api.github.com/users/kirly-af/events{/privacy}","received_events_url":"https://api.github.com/users/kirly-af/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T12:31:26Z","updated_at":"2016-09-28T12:31:26Z","body":"I just wanted to mention there's actually a [proposal](https://github.com/mindeavor/es-pipeline-operator) for that in JS, a (closed) [babel PR](https://github.com/babel/babel/pull/3159) and also a similar [babel plugin](https://github.com/miraks/babel-plugin-pipe-operator).\r\n\r\nAlthough I feel this feature appealing, I kinda share @GeoffreyBooth opinion about not implementing a feature that might work differently in JS. On the one hand this feature might never come to JS (it's not even a stage 0 proposal), and on the other hand CS suffered a lot from implementation conflicts when ES6 came. Both positions make sense and it's quite hard to decide which direction CS should take: keep adding cool nice features or adopt a _wait and see_ policy..."}}
{"actor":{"display_login":"kirly-af"}}