{"action":"created","issue":{"url":"https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/18","repository_url":"https://api.github.com/repos/ghc-proposals/ghc-proposals","labels_url":"https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/18/labels{/name}","comments_url":"https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/18/comments","events_url":"https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/18/events","html_url":"https://github.com/ghc-proposals/ghc-proposals/pull/18","id":181735263,"number":18,"title":"Extension to LambdaCase (\\case2, \\case3)","user":{"login":"Icelandjack","id":501899,"avatar_url":"https://avatars.githubusercontent.com/u/501899?v=3","gravatar_id":"","url":"https://api.github.com/users/Icelandjack","html_url":"https://github.com/Icelandjack","followers_url":"https://api.github.com/users/Icelandjack/followers","following_url":"https://api.github.com/users/Icelandjack/following{/other_user}","gists_url":"https://api.github.com/users/Icelandjack/gists{/gist_id}","starred_url":"https://api.github.com/users/Icelandjack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Icelandjack/subscriptions","organizations_url":"https://api.github.com/users/Icelandjack/orgs","repos_url":"https://api.github.com/users/Icelandjack/repos","events_url":"https://api.github.com/users/Icelandjack/events{/privacy}","received_events_url":"https://api.github.com/users/Icelandjack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":24,"created_at":"2016-10-07T18:19:21Z","updated_at":"2016-10-08T23:34:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ghc-proposals/ghc-proposals/pulls/18","html_url":"https://github.com/ghc-proposals/ghc-proposals/pull/18","diff_url":"https://github.com/ghc-proposals/ghc-proposals/pull/18.diff","patch_url":"https://github.com/ghc-proposals/ghc-proposals/pull/18.patch"},"body":"Extension to `LambdaCase` allowing `\\case2`, `\\case3` to define a function that takes two, three arguments and pattern matches on their product.\r\n\r\nThis lets you write\r\n\r\n```haskell\r\nimport Data.Reflection (foldBy)\r\n\r\ndata B = F | T\r\n\r\nfoldB :: Foldable f => f B -> B\r\nfoldB = foldBy (\\case2 (T, T) -> T; _ -> F) T\r\n```\r\n\r\nrather than\r\n\r\n```haskell\r\nfoldB' :: Foldable f => f B -> B\r\nfoldB' = foldBy (\\a b -> case (a, b) of (T, T) -> T; _ -> F) T\r\n```\r\n\r\nTies in with proposal #19, `foldB` becomes:\r\n\r\n```haskell\r\nfoldB :: Foldable f => f B -> B\r\nfoldB = foldBy (\\case2 T, T -> T; _ -> F) T\r\n```\r\n\r\n[Rendered](https://github.com/Icelandjack/ghc-proposals/blob/case2/proposals/0000-case-n.rst)."},"comment":{"url":"https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/comments/252454388","html_url":"https://github.com/ghc-proposals/ghc-proposals/pull/18#issuecomment-252454388","issue_url":"https://api.github.com/repos/ghc-proposals/ghc-proposals/issues/18","id":252454388,"user":{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars.githubusercontent.com/u/1055245?v=3","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false},"created_at":"2016-10-08T23:34:37Z","updated_at":"2016-10-08T23:34:37Z","body":"@rwbarton Well you can also argue that `\\case` is inconsistent with `\\` as is, so it cuts both ways. I probably learn towards @simonmar's route, but I fear the breaking standardized `\\` will be more controversial than breaking an extension like `\\case`.\r\n\r\n(Of course, in the near term nothing is actually broken as this would be another extension.)"}}
{"actor":{"display_login":"Ericson2314"}}