{"action":"created","issue":{"url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/253","repository_url":"https://api.github.com/repos/dhall-lang/dhall-haskell","labels_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/253/labels{/name}","comments_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/253/comments","events_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/253/events","html_url":"https://github.com/dhall-lang/dhall-haskell/issues/253","id":294575089,"number":253,"title":"Custom contexts with a \"loop\" loop the import resolution process","user":{"login":"ocharles","id":20878,"avatar_url":"https://avatars2.githubusercontent.com/u/20878?v=4","gravatar_id":"","url":"https://api.github.com/users/ocharles","html_url":"https://github.com/ocharles","followers_url":"https://api.github.com/users/ocharles/followers","following_url":"https://api.github.com/users/ocharles/following{/other_user}","gists_url":"https://api.github.com/users/ocharles/gists{/gist_id}","starred_url":"https://api.github.com/users/ocharles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocharles/subscriptions","organizations_url":"https://api.github.com/users/ocharles/orgs","repos_url":"https://api.github.com/users/ocharles/repos","events_url":"https://api.github.com/users/ocharles/events{/privacy}","received_events_url":"https://api.github.com/users/ocharles/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-05T23:08:30Z","updated_at":"2018-02-11T17:15:25Z","closed_at":null,"author_association":"COLLABORATOR","body":"I accidentally wrote the following\r\n\r\n```haskell\r\ncabalContext\r\n  :: Ctx.Context ( Expr.Expr Dhall.Parser.Src Dhall.TypeCheck.X )\r\ncabalContext =\r\n  let\r\n    versionRangeType =\r\n      Dhall.expected versionRange\r\n\r\n  in\r\n  Ctx.empty\r\n    & Ctx.insert \"VersionRange\" versionRangeType\r\n```\r\n\r\nwith\r\n\r\n```haskell\r\nversionRange :: Dhall.Type Cabal.VersionRange\r\nversionRange =\r\n  let\r\n    extract =\r\n      ..\r\n\r\n    expected =\r\n      Expr.Var ( Expr.V \"VersionRange\" 0 )\r\n\r\n  in Dhall.Type { .. }\r\n```\r\n\r\nSee the problem? I've essentially said that `VerisonRange` has type `Var \"VersionRange\"`, which seems to loop the type checker. This was super subtle and took me the best part of 15 minutes to track down, would be great if we could catch this nonsense up front."},"comment":{"url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/comments/364768494","html_url":"https://github.com/dhall-lang/dhall-haskell/issues/253#issuecomment-364768494","issue_url":"https://api.github.com/repos/dhall-lang/dhall-haskell/issues/253","id":364768494,"user":{"login":"Gabriel439","id":1313787,"avatar_url":"https://avatars3.githubusercontent.com/u/1313787?v=4","gravatar_id":"","url":"https://api.github.com/users/Gabriel439","html_url":"https://github.com/Gabriel439","followers_url":"https://api.github.com/users/Gabriel439/followers","following_url":"https://api.github.com/users/Gabriel439/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel439/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel439/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel439/subscriptions","organizations_url":"https://api.github.com/users/Gabriel439/orgs","repos_url":"https://api.github.com/users/Gabriel439/repos","events_url":"https://api.github.com/users/Gabriel439/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel439/received_events","type":"User","site_admin":false},"created_at":"2018-02-11T17:15:25Z","updated_at":"2018-02-11T17:15:25Z","author_association":"COLLABORATOR","body":"Also, the output schema does not need to be fully normalized.  If there are sections that share the same type, you could emit a schema that uses type synonyms to compress it"}}
{"actor":{"display_login":"Gabriel439"}}