{"action":"created","issue":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/889","labels_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/889/labels{/name}","comments_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/889/comments","events_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/889/events","html_url":"https://github.com/elm-lang/elm-compiler/issues/889","id":56679474,"number":889,"title":"Inconsistency/unsoundness in type system due to channels","user":{"login":"imeckler","id":1253566,"avatar_url":"https://avatars.githubusercontent.com/u/1253566?v=3","gravatar_id":"","url":"https://api.github.com/users/imeckler","html_url":"https://github.com/imeckler","followers_url":"https://api.github.com/users/imeckler/followers","following_url":"https://api.github.com/users/imeckler/following{/other_user}","gists_url":"https://api.github.com/users/imeckler/gists{/gist_id}","starred_url":"https://api.github.com/users/imeckler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imeckler/subscriptions","organizations_url":"https://api.github.com/users/imeckler/orgs","repos_url":"https://api.github.com/users/imeckler/repos","events_url":"https://api.github.com/users/imeckler/events{/privacy}","received_events_url":"https://api.github.com/users/imeckler/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-02-05T14:50:13Z","updated_at":"2015-08-11T20:34:05Z","closed_at":null,"body":"Probably this is well known, but I couldn't find an issue on here. Because there's no value restriction on channels in Elm, the type system is unsound (for an appropriate notion of unsoundness) in the usual way. The following incorrect program compiles.\r\n\r\n```elm\r\nimport Signal\r\nimport Html\r\nimport Html.Attributes(style)\r\nimport Html.Events(..)\r\nimport Maybe\r\n\r\nc = Signal.channel Nothing\r\n\r\ns : Signal Int\r\ns = Signal.map (Maybe.withDefault 0) (Signal.subscribe c)\r\n\r\ndraw x =\r\n  Html.div\r\n  [ onClick (Signal.send c (Just \"I am not an Int\"))\r\n  , style [(\"width\", \"100px\"), (\"height\", \"100px\")]\r\n  ]\r\n  [ Html.text (toString (x + 1)) ]\r\n  |> Html.toElement 100 100\r\n\r\nmain = Signal.map draw s\r\n```"},"comment":{"url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/comments/130058404","html_url":"https://github.com/elm-lang/elm-compiler/issues/889#issuecomment-130058404","issue_url":"https://api.github.com/repos/elm-lang/elm-compiler/issues/889","id":130058404,"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-08-11T20:34:05Z","updated_at":"2015-08-11T20:34:05Z","body":"I don't think this is well known, but it's definitely a reproducible bug!\r\n\r\nI pasted that code into the current (0.15.1) Try Elm; it compiled and ran, and when I clicked the \"1\", it turned into \"I am not an Int1\"."}}