{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/5445","labels_url":"https://api.github.com/repos/dotnet/roslyn/issues/5445/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/roslyn/issues/5445/comments","events_url":"https://api.github.com/repos/dotnet/roslyn/issues/5445/events","html_url":"https://github.com/dotnet/roslyn/issues/5445","id":108347070,"number":5445,"title":"Proposal: Forward Pipe Operator","user":{"login":"alrz","id":3105979,"avatar_url":"https://avatars.githubusercontent.com/u/3105979?v=3","gravatar_id":"","url":"https://api.github.com/users/alrz","html_url":"https://github.com/alrz","followers_url":"https://api.github.com/users/alrz/followers","following_url":"https://api.github.com/users/alrz/following{/other_user}","gists_url":"https://api.github.com/users/alrz/gists{/gist_id}","starred_url":"https://api.github.com/users/alrz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alrz/subscriptions","organizations_url":"https://api.github.com/users/alrz/orgs","repos_url":"https://api.github.com/users/alrz/repos","events_url":"https://api.github.com/users/alrz/events{/privacy}","received_events_url":"https://api.github.com/users/alrz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-25T15:24:52Z","updated_at":"2015-09-25T20:53:21Z","closed_at":null,"body":"When you are chaining multiple methods to one another you might end up with something like this:\r\n```C#\r\nConsole.WriteLine(BitConverter.ToString(SHA1.Create().ComputeHash(File.ReadAllBytes(Console.ReadLine()))));\r\n```\r\nUsing forward pipe operator it can be written as (in the same order that they will be executed):\r\n```C#\r\nConsole.ReadLine()\r\n-> File.ReadAllBytes\r\n-> SHA1.Create().ComputeHash\r\n-> BitConverter.ToString\r\n-> Console.WriteLine;\r\n```\r\nWe can take a step further and specify named args (similar to currying proposed in #3171 and #4534):\r\n```C#\r\nConsole.ReadLine()\r\n-> File.ReadAllBytes\r\n-> SHA1.Create().ComputeHash\r\n-> BitConverter.ToString\r\n-> Console.WriteLine(format: \"SHA1: {0}\");\r\n```\r\nThe syntax also plays nice with #5402:\r\n```\r\nConsole.ReadLine() -> File.ReadAllBytes -> SHA1.Create().ComputeHash\r\n-> bytes => foreach(var b in bytes) => Console.Write($\"{b:x2}\");\r\n``` \r\nAnd as mentioned in #5206 and discussed in #347 we can use tuples to support methods with multiple parameters:\r\n```C#\r\ntuple -> dictionary.Add;\r\n```\r\nTo prevent ambiguity, I think this should be allowed only in this context."},"comment":{"url":"https://api.github.com/repos/dotnet/roslyn/issues/comments/143351517","html_url":"https://github.com/dotnet/roslyn/issues/5445#issuecomment-143351517","issue_url":"https://api.github.com/repos/dotnet/roslyn/issues/5445","id":143351517,"user":{"login":"gafter","id":3804346,"avatar_url":"https://avatars.githubusercontent.com/u/3804346?v=3","gravatar_id":"","url":"https://api.github.com/users/gafter","html_url":"https://github.com/gafter","followers_url":"https://api.github.com/users/gafter/followers","following_url":"https://api.github.com/users/gafter/following{/other_user}","gists_url":"https://api.github.com/users/gafter/gists{/gist_id}","starred_url":"https://api.github.com/users/gafter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gafter/subscriptions","organizations_url":"https://api.github.com/users/gafter/orgs","repos_url":"https://api.github.com/users/gafter/repos","events_url":"https://api.github.com/users/gafter/events{/privacy}","received_events_url":"https://api.github.com/users/gafter/received_events","type":"User","site_admin":false},"created_at":"2015-09-25T20:53:20Z","updated_at":"2015-09-25T20:53:20Z","body":"The symbol `->` is already an operator in C#, but the concept could be done with a different syntax."}}