{"action":"created","issue":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/490","repository_url":"https://api.github.com/repos/elm-lang/elm-compiler","labels_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/490/labels{/name}","comments_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/490/comments","events_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/490/events","html_url":"https://github.com/elm-lang/elm-compiler/issues/490","id":27015771,"number":490,"title":"Feature Request: Arbitrary (First-order) Datatypes in Ports","user":{"login":"maxsnew","id":1479741,"avatar_url":"https://avatars.githubusercontent.com/u/1479741?v=3","gravatar_id":"","url":"https://api.github.com/users/maxsnew","html_url":"https://github.com/maxsnew","followers_url":"https://api.github.com/users/maxsnew/followers","following_url":"https://api.github.com/users/maxsnew/following{/other_user}","gists_url":"https://api.github.com/users/maxsnew/gists{/gist_id}","starred_url":"https://api.github.com/users/maxsnew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxsnew/subscriptions","organizations_url":"https://api.github.com/users/maxsnew/orgs","repos_url":"https://api.github.com/users/maxsnew/repos","events_url":"https://api.github.com/users/maxsnew/events{/privacy}","received_events_url":"https://api.github.com/users/maxsnew/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/elm-lang/elm-compiler/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/milestones/2","html_url":"https://github.com/elm-lang/elm-compiler/milestones/Ports","labels_url":"https://api.github.com/repos/elm-lang/elm-compiler/milestones/2/labels","id":617380,"number":2,"title":"Ports","description":"Make various enhancements to ports","creator":{"login":"evancz","id":1658058,"avatar_url":"https://avatars.githubusercontent.com/u/1658058?v=3","gravatar_id":"","url":"https://api.github.com/users/evancz","html_url":"https://github.com/evancz","followers_url":"https://api.github.com/users/evancz/followers","following_url":"https://api.github.com/users/evancz/following{/other_user}","gists_url":"https://api.github.com/users/evancz/gists{/gist_id}","starred_url":"https://api.github.com/users/evancz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evancz/subscriptions","organizations_url":"https://api.github.com/users/evancz/orgs","repos_url":"https://api.github.com/users/evancz/repos","events_url":"https://api.github.com/users/evancz/events{/privacy}","received_events_url":"https://api.github.com/users/evancz/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":8,"state":"closed","created_at":"2014-04-01T23:01:09Z","updated_at":"2015-10-03T02:10:36Z","due_on":null,"closed_at":"2015-10-03T02:10:36Z"},"comments":23,"created_at":"2014-02-05T23:51:34Z","updated_at":"2016-09-08T09:37:17Z","closed_at":"2015-08-06T02:20:21Z","body":"This seems pretty simple to implement:\r\n```haskell\r\ndata Foo a = Bar String\r\n           | Baz (Foo a) Int\r\nx = Bar \"bleh\"\r\ny = Baz x 7\r\n```\r\nthen `x` and `y` could be serialized to the following javascript (field names could easily be something else):\r\n```javascript\r\nvar x = { _ctor: \"Bar\", _0: \"bleh\" }\r\nvar y = { _ctor: \"Baz\", _0: x, _1: 7 }\r\n```\r\nThe only problem I see with this is that the serialization of `Maybe` would be inconsistent with this.\r\n\r\nRight now it's actually impossible to serialize a Sum type. Even if we're unsure about doing this in general, we definitely need to at least support the `Either` type. Currently I'm doing the following to get around this limitation\r\n```haskell\r\ntype Either' a b = (Maybe a, Maybe b)\r\n```\r\nwhere I ignore the 2nd value if the first one is non-null, but this is obviously suboptimal."},"comment":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/comments/245545643","html_url":"https://github.com/elm-lang/elm-compiler/issues/490#issuecomment-245545643","issue_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/490","id":245545643,"user":{"login":"thewoolleyman","id":158,"avatar_url":"https://avatars.githubusercontent.com/u/158?v=3","gravatar_id":"","url":"https://api.github.com/users/thewoolleyman","html_url":"https://github.com/thewoolleyman","followers_url":"https://api.github.com/users/thewoolleyman/followers","following_url":"https://api.github.com/users/thewoolleyman/following{/other_user}","gists_url":"https://api.github.com/users/thewoolleyman/gists{/gist_id}","starred_url":"https://api.github.com/users/thewoolleyman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thewoolleyman/subscriptions","organizations_url":"https://api.github.com/users/thewoolleyman/orgs","repos_url":"https://api.github.com/users/thewoolleyman/repos","events_url":"https://api.github.com/users/thewoolleyman/events{/privacy}","received_events_url":"https://api.github.com/users/thewoolleyman/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T09:37:17Z","updated_at":"2016-09-08T09:37:17Z","body":"Hello,\r\n\r\nWhat is the status of this?  https://github.com/elm-lang/elm-plans/issues/17 is still open with no status, but the repo is \"deprecated\"...\r\n\r\nThanks,\r\n-- Chad"}}
{"actor":{"display_login":"thewoolleyman"}}