{"action":"created","issue":{"url":"https://api.github.com/repos/purescript-contrib/purescript-argonaut-codecs/issues/19","repository_url":"https://api.github.com/repos/purescript-contrib/purescript-argonaut-codecs","labels_url":"https://api.github.com/repos/purescript-contrib/purescript-argonaut-codecs/issues/19/labels{/name}","comments_url":"https://api.github.com/repos/purescript-contrib/purescript-argonaut-codecs/issues/19/comments","events_url":"https://api.github.com/repos/purescript-contrib/purescript-argonaut-codecs/issues/19/events","html_url":"https://github.com/purescript-contrib/purescript-argonaut-codecs/issues/19","id":169461029,"number":19,"title":"Unfancy JSON transcoder","user":{"login":"texastoland","id":48431,"avatar_url":"https://avatars.githubusercontent.com/u/48431?v=3","gravatar_id":"","url":"https://api.github.com/users/texastoland","html_url":"https://github.com/texastoland","followers_url":"https://api.github.com/users/texastoland/followers","following_url":"https://api.github.com/users/texastoland/following{/other_user}","gists_url":"https://api.github.com/users/texastoland/gists{/gist_id}","starred_url":"https://api.github.com/users/texastoland/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/texastoland/subscriptions","organizations_url":"https://api.github.com/users/texastoland/orgs","repos_url":"https://api.github.com/users/texastoland/repos","events_url":"https://api.github.com/users/texastoland/events{/privacy}","received_events_url":"https://api.github.com/users/texastoland/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-08-04T20:02:35Z","updated_at":"2016-08-05T13:26:50Z","closed_at":"2016-08-05T12:59:08Z","body":"I'm struggling to transcode a record with native types and a single foreign `Json` entry for round trip to `localStorage`. My naive untested yet solution is:\r\n\r\n```purs\r\n-- I want to transcode this\r\nnewtype Event = Event { id: String, data: Json }\r\n\r\nnewtype UnsafeJson a = Unsafe Json a\r\n\r\ninstance encodeJsonUnsafe Json :: EncodeJson (Unsafe Json a) where\r\n  encodeJson = unsafeCoerce\r\n\r\ninstance decodeJsonUnsafe Json :: DecodeJson (Unsafe Json a) where\r\n  decodeJson = Left <<< unsafeCoerce\r\n```\r\n\r\n1. What would be preferable?\r\n2. Could instances be provided for some `newtype` that transcode without necessarily doing anything <q>smart</q>? I know I can manually `stringify`/`parse` but it wouldn't work with clients of the codecs (specifically https://github.com/texastoland/purescript-localstorage/blob/refactor/src/DOM/WebStorage/JSON.purs)."},"comment":{"url":"https://api.github.com/repos/purescript-contrib/purescript-argonaut-codecs/issues/comments/237849705","html_url":"https://github.com/purescript-contrib/purescript-argonaut-codecs/issues/19#issuecomment-237849705","issue_url":"https://api.github.com/repos/purescript-contrib/purescript-argonaut-codecs/issues/19","id":237849705,"user":{"login":"garyb","id":693642,"avatar_url":"https://avatars.githubusercontent.com/u/693642?v=3","gravatar_id":"","url":"https://api.github.com/users/garyb","html_url":"https://github.com/garyb","followers_url":"https://api.github.com/users/garyb/followers","following_url":"https://api.github.com/users/garyb/following{/other_user}","gists_url":"https://api.github.com/users/garyb/gists{/gist_id}","starred_url":"https://api.github.com/users/garyb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/garyb/subscriptions","organizations_url":"https://api.github.com/users/garyb/orgs","repos_url":"https://api.github.com/users/garyb/repos","events_url":"https://api.github.com/users/garyb/events{/privacy}","received_events_url":"https://api.github.com/users/garyb/received_events","type":"User","site_admin":false},"created_at":"2016-08-05T13:26:50Z","updated_at":"2016-08-05T13:26:50Z","body":"Ah I see. I wouldn't consider `Generic` the common use case, but that's just because we wrote all the codecs by hand in SlamData, but I guess it makes sense.\r\n\r\nBy the way: #20 :smile:"}}
{"actor":{"display_login":"garyb"}}