{"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,"milestone":null,"comments":23,"created_at":"2015-11-12T17:00:48Z","updated_at":"2016-05-02T16:17:05Z","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/216281077","html_url":"https://github.com/jashkenas/coffeescript/pull/4144#issuecomment-216281077","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/4144","id":216281077,"user":{"login":"blitmap","id":1560788,"avatar_url":"https://avatars.githubusercontent.com/u/1560788?v=3","gravatar_id":"","url":"https://api.github.com/users/blitmap","html_url":"https://github.com/blitmap","followers_url":"https://api.github.com/users/blitmap/followers","following_url":"https://api.github.com/users/blitmap/following{/other_user}","gists_url":"https://api.github.com/users/blitmap/gists{/gist_id}","starred_url":"https://api.github.com/users/blitmap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blitmap/subscriptions","organizations_url":"https://api.github.com/users/blitmap/orgs","repos_url":"https://api.github.com/users/blitmap/repos","events_url":"https://api.github.com/users/blitmap/events{/privacy}","received_events_url":"https://api.github.com/users/blitmap/received_events","type":"User","site_admin":false},"created_at":"2016-05-02T16:17:05Z","updated_at":"2016-05-02T16:17:05Z","body":"@vendethiel Huh - TIL.  I thought `then` was used for line continuations.  So yes, my idea doesn't make sense anymore :smile:"}}