{"action":"created","issue":{"url":"https://api.github.com/repos/thoughtbot/Argo/issues/72","labels_url":"https://api.github.com/repos/thoughtbot/Argo/issues/72/labels{/name}","comments_url":"https://api.github.com/repos/thoughtbot/Argo/issues/72/comments","events_url":"https://api.github.com/repos/thoughtbot/Argo/issues/72/events","html_url":"https://github.com/thoughtbot/Argo/pull/72","id":59142137,"number":72,"title":"Implement a Parser type for error messaging","user":{"login":"tonyd256","id":1169797,"avatar_url":"https://avatars.githubusercontent.com/u/1169797?v=3","gravatar_id":"","url":"https://api.github.com/users/tonyd256","html_url":"https://github.com/tonyd256","followers_url":"https://api.github.com/users/tonyd256/followers","following_url":"https://api.github.com/users/tonyd256/following{/other_user}","gists_url":"https://api.github.com/users/tonyd256/gists{/gist_id}","starred_url":"https://api.github.com/users/tonyd256/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonyd256/subscriptions","organizations_url":"https://api.github.com/users/tonyd256/orgs","repos_url":"https://api.github.com/users/tonyd256/repos","events_url":"https://api.github.com/users/tonyd256/events{/privacy}","received_events_url":"https://api.github.com/users/tonyd256/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/thoughtbot/Argo/milestones/1","html_url":"https://github.com/thoughtbot/Argo/milestones/1.0.0%20-%20No%20More%20Excuses","labels_url":"https://api.github.com/repos/thoughtbot/Argo/milestones/1/labels","id":991894,"number":1,"title":"1.0.0 - No More Excuses","description":"We should stop making excuses for ourselves and put out a 1.0 release. We should plan on releasing alongside Swift 1.2.","creator":{"login":"gfontenot","id":124499,"avatar_url":"https://avatars.githubusercontent.com/u/124499?v=3","gravatar_id":"","url":"https://api.github.com/users/gfontenot","html_url":"https://github.com/gfontenot","followers_url":"https://api.github.com/users/gfontenot/followers","following_url":"https://api.github.com/users/gfontenot/following{/other_user}","gists_url":"https://api.github.com/users/gfontenot/gists{/gist_id}","starred_url":"https://api.github.com/users/gfontenot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gfontenot/subscriptions","organizations_url":"https://api.github.com/users/gfontenot/orgs","repos_url":"https://api.github.com/users/gfontenot/repos","events_url":"https://api.github.com/users/gfontenot/events{/privacy}","received_events_url":"https://api.github.com/users/gfontenot/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":6,"state":"open","created_at":"2015-02-23T19:38:17Z","updated_at":"2015-03-02T14:30:36Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-02-26T20:56:18Z","updated_at":"2015-03-05T19:29:29Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/thoughtbot/Argo/pulls/72","html_url":"https://github.com/thoughtbot/Argo/pull/72","diff_url":"https://github.com/thoughtbot/Argo/pull/72.diff","patch_url":"https://github.com/thoughtbot/Argo/pull/72.patch"},"body":"Using a Parser type allows us to abstract the return type away from the decode\nfunction. This shifts some naming to what Aeson uses for an easier comparison\nto their technique. The old `decode` function is now `fromJSON` and the new\n`decode` function is a global function with multiple implementations for\ndifferent return types. It also abstracts away the JSON.parse function. The\nuser can now just call decode on their JSON and get back the Optional decoded\ntype, or if they prefer they can get the Parser type directly and use it to\nview errors.\n\nWith Parser, we also don't have dependence on the return type. Someone using a\nResult framework like LlamaKit could implement a global decode function for\nResult and everything internal would work as normal."},"comment":{"url":"https://api.github.com/repos/thoughtbot/Argo/issues/comments/77433984","html_url":"https://github.com/thoughtbot/Argo/pull/72#issuecomment-77433984","issue_url":"https://api.github.com/repos/thoughtbot/Argo/issues/72","id":77433984,"user":{"login":"nvh","id":248861,"avatar_url":"https://avatars.githubusercontent.com/u/248861?v=3","gravatar_id":"","url":"https://api.github.com/users/nvh","html_url":"https://github.com/nvh","followers_url":"https://api.github.com/users/nvh/followers","following_url":"https://api.github.com/users/nvh/following{/other_user}","gists_url":"https://api.github.com/users/nvh/gists{/gist_id}","starred_url":"https://api.github.com/users/nvh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvh/subscriptions","organizations_url":"https://api.github.com/users/nvh/orgs","repos_url":"https://api.github.com/users/nvh/repos","events_url":"https://api.github.com/users/nvh/events{/privacy}","received_events_url":"https://api.github.com/users/nvh/received_events","type":"User","site_admin":false},"created_at":"2015-03-05T19:29:29Z","updated_at":"2015-03-05T19:29:29Z","body":"I really like this solution, but I think the name `Parser` is a bit confusing. It's just a value type and not doing much parsing, like the name suggests. Wouldn't it be better to call it `Result` or `ParseResult`?\r\n\r\nAlso, I think it would be nice to have a constructor for `Parser` that takes a `T`, or a global `pure()` function, so we can forget about the boxing if we create a `Parser`."}}