{"action":"created","issue":{"url":"https://api.github.com/repos/nikita-volkov/record/issues/1","labels_url":"https://api.github.com/repos/nikita-volkov/record/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/nikita-volkov/record/issues/1/comments","events_url":"https://api.github.com/repos/nikita-volkov/record/issues/1/events","html_url":"https://github.com/nikita-volkov/record/issues/1","id":54825755,"number":1,"title":"Section syntax","user":{"login":"nikita-volkov","id":1560937,"avatar_url":"https://avatars.githubusercontent.com/u/1560937?v=3","gravatar_id":"","url":"https://api.github.com/users/nikita-volkov","html_url":"https://github.com/nikita-volkov","followers_url":"https://api.github.com/users/nikita-volkov/followers","following_url":"https://api.github.com/users/nikita-volkov/following{/other_user}","gists_url":"https://api.github.com/users/nikita-volkov/gists{/gist_id}","starred_url":"https://api.github.com/users/nikita-volkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikita-volkov/subscriptions","organizations_url":"https://api.github.com/users/nikita-volkov/orgs","repos_url":"https://api.github.com/users/nikita-volkov/repos","events_url":"https://api.github.com/users/nikita-volkov/events{/privacy}","received_events_url":"https://api.github.com/users/nikita-volkov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-01-19T23:37:00Z","updated_at":"2015-01-20T20:09:38Z","closed_at":null,"body":"## Problem\r\n\r\n> How would this work with Applicative notation, like\r\n```haskell\r\nparsePerson = Person <$> parseName <*> parseAge\r\n```\r\n\r\n## Proposal\r\n\r\nUnquote an expression of the following form\r\n\r\n```haskell\r\n[r| {name, age} |]\r\n```\r\n\r\nto\r\n\r\n```haskell\r\n\\name age -> Record2 age name :: name -> age -> Record2 \"age\" age \"name\" name\r\n```\r\n\r\n(Note the reordering of arguments).\r\n\r\nThen it will be possible to use it like this:\r\n\r\n```haskell\r\n[r| {name, age} |] <$> parseName <*> parseAge\r\n```\r\n\r\n### Extras\r\n\r\nThis can be extended even further to allow to partially initialize the record. E.g.:\r\n\r\n```haskell\r\n[r| {name, age = 23} |] <$> parseName\r\n```\r\n\r\n---\r\n\r\nCredits for [the initial proposal](http://www.reddit.com/r/haskell/comments/2svayz/i_think_ive_nailed_it_ive_solved_the_records/cnu9nvn) go to a Reddit user _htebalaka_. Thank you!"},"comment":{"url":"https://api.github.com/repos/nikita-volkov/record/issues/comments/70723530","html_url":"https://github.com/nikita-volkov/record/issues/1#issuecomment-70723530","issue_url":"https://api.github.com/repos/nikita-volkov/record/issues/1","id":70723530,"user":{"login":"htebalaka","id":8785031,"avatar_url":"https://avatars.githubusercontent.com/u/8785031?v=3","gravatar_id":"","url":"https://api.github.com/users/htebalaka","html_url":"https://github.com/htebalaka","followers_url":"https://api.github.com/users/htebalaka/followers","following_url":"https://api.github.com/users/htebalaka/following{/other_user}","gists_url":"https://api.github.com/users/htebalaka/gists{/gist_id}","starred_url":"https://api.github.com/users/htebalaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htebalaka/subscriptions","organizations_url":"https://api.github.com/users/htebalaka/orgs","repos_url":"https://api.github.com/users/htebalaka/repos","events_url":"https://api.github.com/users/htebalaka/events{/privacy}","received_events_url":"https://api.github.com/users/htebalaka/received_events","type":"User","site_admin":false},"created_at":"2015-01-20T20:09:37Z","updated_at":"2015-01-20T20:09:37Z","body":"I kind of assumed that was the goal. I thought it'd be nice to be able to postprocess the generated function (for newtypes mainly, but also for functions like `foo :: {a :: Int , b :: Int , c :: Int} -> IO ()`. If you had something like `{<expr>\\b, c=3, a} ==> \\b a -> <expr> {b=x, c=3, a=y}`, which could be used to convert anything expecting a record to a function with positional arguments in any order, without needing  a lambda. Then if you had `{\\b, c=3, a}` as shorthand for `{id\\b, c=3, a}` you could disambiguate.\r\n\r\nThen the syntax without the backslash character would indicate a record pattern/expression, and I /think/ would handle both RecordWildCards and NamedFieldPuns cleanly."}}