{"action":"created","issue":{"url":"https://api.github.com/repos/purescript/purescript/issues/1442","labels_url":"https://api.github.com/repos/purescript/purescript/issues/1442/labels{/name}","comments_url":"https://api.github.com/repos/purescript/purescript/issues/1442/comments","events_url":"https://api.github.com/repos/purescript/purescript/issues/1442/events","html_url":"https://github.com/purescript/purescript/issues/1442","id":104009696,"number":1442,"title":"Instance resolution and referential transparency","user":{"login":"passy","id":9906,"avatar_url":"https://avatars.githubusercontent.com/u/9906?v=3","gravatar_id":"","url":"https://api.github.com/users/passy","html_url":"https://github.com/passy","followers_url":"https://api.github.com/users/passy/followers","following_url":"https://api.github.com/users/passy/following{/other_user}","gists_url":"https://api.github.com/users/passy/gists{/gist_id}","starred_url":"https://api.github.com/users/passy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passy/subscriptions","organizations_url":"https://api.github.com/users/passy/orgs","repos_url":"https://api.github.com/users/passy/repos","events_url":"https://api.github.com/users/passy/events{/privacy}","received_events_url":"https://api.github.com/users/passy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-31T08:31:00Z","updated_at":"2015-08-31T12:44:35Z","closed_at":null,"body":"Apologies for the rather big test case, I'm not sure how to reduce this further:\r\n\r\n```purescript\r\nmodule Mod where\r\n\r\nimport Prelude\r\n\r\nimport qualified Halogen.HTML as H\r\nimport qualified Halogen.HTML.Core as H\r\nimport qualified Halogen.HTML.Properties as P\r\nimport qualified Halogen.HTML.Events as E\r\nimport qualified Halogen.HTML.Events.Forms as E\r\nimport qualified Halogen.HTML.Events.Handler as E\r\nimport qualified Halogen.HTML.Events.Types as E\r\n\r\nimport Control.Apply\r\nimport Data.Functor\r\nimport Halogen\r\nimport Halogen.Component\r\nimport Halogen.Query.StateF\r\n\r\nnewtype State = State { stuff :: String }\r\ndata Input a = NoOp a\r\n\r\nc :: forall g p. (Functor g) => Component State Input g p\r\nc = component render eval\r\n    where\r\n    render :: Render State Input p\r\n    render _ = H.div_ []\r\n\r\n    eval :: Eval Input State Input g\r\n    eval (NoOp next) = modify (\\(State s) -> State s) $> next\r\n```\r\n\r\nIn the final line, replacing the `(\\(State s) -> State s)` with `id` causes a compiler error:\r\n\r\n```\r\nError found:\r\nError in module PscTest:\r\nError in value declaration c:\r\nError at PscTest.purs line 21, column 1 - line 22, column 1:\r\n  No instance found for Data.Inject.Inject (Halogen.Query.StateF.StateF _27) g10\r\nSee https://github.com/purescript/purescript/wiki/Error-Code-NoInstanceFound for more information, or to contribute content related to this error.\r\n```\r\n\r\nI'm not sure if I'm doing something stupid here, but to me it seems the two equations should be equal.\r\n\r\n```bash\r\n$ psc --version\r\n0.7.4.1\r\n```"},"comment":{"url":"https://api.github.com/repos/purescript/purescript/issues/comments/136361305","html_url":"https://github.com/purescript/purescript/issues/1442#issuecomment-136361305","issue_url":"https://api.github.com/repos/purescript/purescript/issues/1442","id":136361305,"user":{"login":"passy","id":9906,"avatar_url":"https://avatars.githubusercontent.com/u/9906?v=3","gravatar_id":"","url":"https://api.github.com/users/passy","html_url":"https://github.com/passy","followers_url":"https://api.github.com/users/passy/followers","following_url":"https://api.github.com/users/passy/following{/other_user}","gists_url":"https://api.github.com/users/passy/gists{/gist_id}","starred_url":"https://api.github.com/users/passy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/passy/subscriptions","organizations_url":"https://api.github.com/users/passy/orgs","repos_url":"https://api.github.com/users/passy/repos","events_url":"https://api.github.com/users/passy/events{/privacy}","received_events_url":"https://api.github.com/users/passy/received_events","type":"User","site_admin":false},"created_at":"2015-08-31T12:44:35Z","updated_at":"2015-08-31T12:44:35Z","body":"Cool, I'll give that a try. :)\r\n\r\nSo, is it expected that the compiler cannot infer the type in these situations? Originally I had `State` as a type synonym and since there's no way for me to manually unwrap and rewrap the type I couldn't figure out how to make it compile at all."}}