{"action":"opened","issue":{"url":"https://api.github.com/repos/cloudRoutine/issueTestRepo/issues/404","repository_url":"https://api.github.com/repos/cloudRoutine/issueTestRepo","labels_url":"https://api.github.com/repos/cloudRoutine/issueTestRepo/issues/404/labels{/name}","comments_url":"https://api.github.com/repos/cloudRoutine/issueTestRepo/issues/404/comments","events_url":"https://api.github.com/repos/cloudRoutine/issueTestRepo/issues/404/events","html_url":"https://github.com/cloudRoutine/issueTestRepo/issues/404","id":182467052,"number":404,"title":"Add Haskell-style operator sections","user":{"login":"cloudRoutine","id":680051,"avatar_url":"https://avatars.githubusercontent.com/u/680051?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudRoutine","html_url":"https://github.com/cloudRoutine","followers_url":"https://api.github.com/users/cloudRoutine/followers","following_url":"https://api.github.com/users/cloudRoutine/following{/other_user}","gists_url":"https://api.github.com/users/cloudRoutine/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudRoutine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudRoutine/subscriptions","organizations_url":"https://api.github.com/users/cloudRoutine/orgs","repos_url":"https://api.github.com/users/cloudRoutine/repos","events_url":"https://api.github.com/users/cloudRoutine/events{/privacy}","received_events_url":"https://api.github.com/users/cloudRoutine/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cloudRoutine/issueTestRepo/labels/declined","name":"declined","color":"171819"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-10-12T08:39:20Z","updated_at":"2016-10-12T08:39:20Z","closed_at":null,"body":"# Idea 7067304: Add Haskell-style operator sections #\n\n**Status : declined**  \n**Submitted by luketopia on 2/7/2015 12:00:00 AM**  \n**21 votes**\n\nImagine that you have a list of integers, and you want to filter it down to all the numbers greater than 10. You might erroneously try to partially apply the greater than operator as follows:\r\nnums |> Seq.filter ((>) 10)\r\nUnfortunately, this won't have the intended effect, because the arguments are applied to the operator in the wrong order. To get the intended effect you have to do\r\nnums |> Seq.filter ((<) 10)\r\nwhich looks backwards and is confusing. Therefore, you end up often just using a lambda to control the order of application without reversing the operator.\r\nnums |> Seq.filter (fun x -> x > 10)\r\nWhat you really want is Haskell's notion of operator sections, where you can place one of the operands inside the parentheses on either side of the operator to make it clear which argument you intend to apply first.\r\nSo for instance, to find all the numbers greater than 10 you do\r\nnums |> Seq.filter (>10)\r\nwhereas to find all the numbers 10 is greater than you do\r\nnums |> Seq.filter (10>)\r\nI think this would fit very well with the existing syntax. Haskell has both notations and it doesn't cause any issues except with minus due to its duality as a unary and binary operator. As a side note, Haskell also allows sections to be used with functions called with the infix notation (that places the function name in backticks), which is sometimes more succinct than a lambda.\r\nhttps://wiki.haskell.org/Section_of_an_infix_operator\n\n\n\n## Response \n** by fslang-admin on 7/17/2015 12:00:00 AM **\n\nMany thanks for this suggestion. It is being marked as declined – for discussion see the comments.\r\nFurther comments, use cases, information welcome\r\nDon Syme, F# Language and Core Library Evolution.\n[Archived Uservoice Comments](../tree/master/archive/suggestion-7067304-add-haskell-style-operator-sections.md#comments)\n"}}
{"actor":{"display_login":"cloudRoutine"}}