{"action":"created","issue":{"url":"https://api.github.com/repos/purescript/purescript/issues/1293","labels_url":"https://api.github.com/repos/purescript/purescript/issues/1293/labels{/name}","comments_url":"https://api.github.com/repos/purescript/purescript/issues/1293/comments","events_url":"https://api.github.com/repos/purescript/purescript/issues/1293/events","html_url":"https://github.com/purescript/purescript/issues/1293","id":96317430,"number":1293,"title":"Confusing error message?","user":{"login":"Javran","id":1096354,"avatar_url":"https://avatars.githubusercontent.com/u/1096354?v=3","gravatar_id":"","url":"https://api.github.com/users/Javran","html_url":"https://github.com/Javran","followers_url":"https://api.github.com/users/Javran/followers","following_url":"https://api.github.com/users/Javran/following{/other_user}","gists_url":"https://api.github.com/users/Javran/gists{/gist_id}","starred_url":"https://api.github.com/users/Javran/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Javran/subscriptions","organizations_url":"https://api.github.com/users/Javran/orgs","repos_url":"https://api.github.com/users/Javran/repos","events_url":"https://api.github.com/users/Javran/events{/privacy}","received_events_url":"https://api.github.com/users/Javran/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-21T13:41:53Z","updated_at":"2015-07-21T13:45:06Z","closed_at":null,"body":"In the following code, line `t1 {n: 10}` fails to compile:\r\n\r\n```purescript\r\nmodule Main where\r\n\r\nimport Prelude\r\nimport Control.Monad.Eff\r\nimport Control.Monad.Eff.Console\r\n\r\ntype Typ1 = forall a. {n :: Int | a}\r\ntype Typ2 a = {n :: Int | a}\r\n\r\nt1 :: forall eff . Typ1 -> Eff (console :: CONSOLE | eff) Unit\r\nt1 v = log (show v.n)\r\n\r\nt2 :: forall eff a . {n :: Int | a} -> Eff (console :: CONSOLE | eff) Unit\r\nt2 v = log (show v.n)\r\n\r\nmain :: forall eff . Eff (console :: CONSOLE | eff) Unit\r\nmain = do\r\n  -- t1 {n:10}\r\n  t2 {n:10}\r\n```\r\n\r\nThe error message is:\r\n\r\n```\r\nError at Main.purs line 18, column 3 - line 19, column 3:\r\n  Expression\r\n    { n: 10}\r\n  does not have type\r\n    { n :: Prim.Int | a0 }\r\n```\r\n\r\nThis is a little bit confusing to me, as `{n :: Int | a0} ~ {n :: Int}` seems unifiable with a0 = zero.\r\nOr maybe there are more going on behind the scenes?\r\n"},"comment":{"url":"https://api.github.com/repos/purescript/purescript/issues/comments/123310209","html_url":"https://github.com/purescript/purescript/issues/1293#issuecomment-123310209","issue_url":"https://api.github.com/repos/purescript/purescript/issues/1293","id":123310209,"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":"2015-07-21T13:45:06Z","updated_at":"2015-07-21T13:45:06Z","body":"I think there is no type that will unify with Typ1. If you expand the synonym, consider:\r\n\r\n``` purescript\r\nt1 :: forall eff . (forall a. {n :: Int | a}) -> Eff (console :: CONSOLE | eff) Unit\r\n```\r\n\r\n(It's not a rank-1 type, there's no way of providing the inner `a`)"}}