{"action":"created","issue":{"url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3168","repository_url":"https://api.github.com/repos/idris-lang/Idris-dev","labels_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3168/labels{/name}","comments_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3168/comments","events_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3168/events","html_url":"https://github.com/idris-lang/Idris-dev/issues/3168","id":154900757,"number":3168,"title":"Mutuality around an interface","user":{"login":"gpyh","id":6893840,"avatar_url":"https://avatars.githubusercontent.com/u/6893840?v=3","gravatar_id":"","url":"https://api.github.com/users/gpyh","html_url":"https://github.com/gpyh","followers_url":"https://api.github.com/users/gpyh/followers","following_url":"https://api.github.com/users/gpyh/following{/other_user}","gists_url":"https://api.github.com/users/gpyh/gists{/gist_id}","starred_url":"https://api.github.com/users/gpyh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpyh/subscriptions","organizations_url":"https://api.github.com/users/gpyh/orgs","repos_url":"https://api.github.com/users/gpyh/repos","events_url":"https://api.github.com/users/gpyh/events{/privacy}","received_events_url":"https://api.github.com/users/gpyh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-15T10:09:26Z","updated_at":"2016-05-15T10:18:48Z","closed_at":null,"body":"That's a bad title for what I am trying to explain, but whatever.\r\n\r\nConsider this: \r\n\r\n```idris\r\ninterface MyInterface a where\r\n  bar : a -> b\r\n  bar : ?bar_rhs\r\n  foo : a -> b\r\n  foo = bar\r\n```\r\n\r\n`foo` depends on `bar`. They both provide a default implementation and depend on the type of the implementation.\r\n\r\nAn implementation can override `foo`, which is fine, but I don't want `bar` to be overridden. I need it outside of the interface.\r\n\r\nIn Haskell, I would do something akin to this:\r\n\r\n```idris\r\nbar : MyInterface a => a -> b\r\nbar : ?bar_rhs\r\n\r\ninterface MyInterface a where\r\n  foo : a -> b\r\n  foo = bar\r\n```\r\n\r\nProblem is, the order is messed up because bar depends on `MyInterface`.\r\n\r\nSymmetrically:\r\n\r\n```idris\r\ninterface MyInterface a where\r\n  foo : a -> b\r\n  foo = bar\r\n\r\nbar : MyInterface a => a -> b\r\nbar : ?bar_rhs\r\n```\r\n\r\n`foo` is trying to use the `bar` function that is not already defined. \r\n\r\nHow such a problem would be solve?\r\n"},"comment":{"url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/comments/219277064","html_url":"https://github.com/idris-lang/Idris-dev/issues/3168#issuecomment-219277064","issue_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/3168","id":219277064,"user":{"login":"ahmadsalim","id":1647846,"avatar_url":"https://avatars.githubusercontent.com/u/1647846?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmadsalim","html_url":"https://github.com/ahmadsalim","followers_url":"https://api.github.com/users/ahmadsalim/followers","following_url":"https://api.github.com/users/ahmadsalim/following{/other_user}","gists_url":"https://api.github.com/users/ahmadsalim/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmadsalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmadsalim/subscriptions","organizations_url":"https://api.github.com/users/ahmadsalim/orgs","repos_url":"https://api.github.com/users/ahmadsalim/repos","events_url":"https://api.github.com/users/ahmadsalim/events{/privacy}","received_events_url":"https://api.github.com/users/ahmadsalim/received_events","type":"User","site_admin":false},"created_at":"2016-05-15T10:18:48Z","updated_at":"2016-05-15T10:18:48Z","body":"Have you tried putting things in a mutual block?"}}