{"action":"created","issue":{"url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/issues/83","labels_url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/issues/83/comments","events_url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/issues/83/events","html_url":"https://github.com/elm-lang/package.elm-lang.org/issues/83","id":106420290,"number":83,"title":"Native review for nphollon/record-builder","user":{"login":"nphollon","id":1874895,"avatar_url":"https://avatars.githubusercontent.com/u/1874895?v=3","gravatar_id":"","url":"https://api.github.com/users/nphollon","html_url":"https://github.com/nphollon","followers_url":"https://api.github.com/users/nphollon/followers","following_url":"https://api.github.com/users/nphollon/following{/other_user}","gists_url":"https://api.github.com/users/nphollon/gists{/gist_id}","starred_url":"https://api.github.com/users/nphollon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nphollon/subscriptions","organizations_url":"https://api.github.com/users/nphollon/orgs","repos_url":"https://api.github.com/users/nphollon/repos","events_url":"https://api.github.com/users/nphollon/events{/privacy}","received_events_url":"https://api.github.com/users/nphollon/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/labels/NativeReview","name":"NativeReview","color":"ffffff"},{"url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/labels/NativeReview-waiting-for-author","name":"NativeReview-waiting-for-author","color":"fad8c7"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-14T20:22:43Z","updated_at":"2015-09-15T19:40:31Z","closed_at":null,"body":"https://github.com/nphollon/record-builder\r\n\r\nThis library creates a record from a dictionary. The one public function is pure but does carry the risk of a runtime error (if the dictionary's fields have a different type than the record's fields). I look forward to your feedback.\r\n"},"comment":{"url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/issues/comments/140514637","html_url":"https://github.com/elm-lang/package.elm-lang.org/issues/83#issuecomment-140514637","issue_url":"https://api.github.com/repos/elm-lang/package.elm-lang.org/issues/83","id":140514637,"user":{"login":"rtfeldman","id":1094080,"avatar_url":"https://avatars.githubusercontent.com/u/1094080?v=3","gravatar_id":"","url":"https://api.github.com/users/rtfeldman","html_url":"https://github.com/rtfeldman","followers_url":"https://api.github.com/users/rtfeldman/followers","following_url":"https://api.github.com/users/rtfeldman/following{/other_user}","gists_url":"https://api.github.com/users/rtfeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/rtfeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtfeldman/subscriptions","organizations_url":"https://api.github.com/users/rtfeldman/orgs","repos_url":"https://api.github.com/users/rtfeldman/repos","events_url":"https://api.github.com/users/rtfeldman/events{/privacy}","received_events_url":"https://api.github.com/users/rtfeldman/received_events","type":"User","site_admin":false},"created_at":"2015-09-15T19:40:31Z","updated_at":"2015-09-15T19:40:31Z","body":"Now that I understand the use case, let me propose an alternative that does not require `Native`.\r\n\r\nI write a lot of decoders for this exact use case, using this style: https://gist.github.com/rtfeldman/255c5dbbf517bfda1118\r\n\r\nThat's not significantly more verbose than the sample use cases for `build`; the only comparative drawback is that what you get back works on a `Value` or a `String` but not a `Dict String a`.\r\n\r\nI am about to head out the door, so I'm not going to attempt an implementation, but conceptually I don't see a reason you couldn't write an `andMap` (or `|:` for brevity) implementation for `Dict` that gives you back a `Result a` instead of a `Decoder`, and which you could then use in the style of that gist to partially apply your way through a type alias constructor function until you got back `Result String record` representing either what you wanted or an error message string explaining which expected `Dict` key was missing."}}