{"action":"created","issue":{"url":"https://api.github.com/repos/agda/agda/issues/1652","labels_url":"https://api.github.com/repos/agda/agda/issues/1652/labels{/name}","comments_url":"https://api.github.com/repos/agda/agda/issues/1652/comments","events_url":"https://api.github.com/repos/agda/agda/issues/1652/events","html_url":"https://github.com/agda/agda/issues/1652","id":107026235,"number":1652,"title":"Rewrite rules in parametrized modules","user":{"login":"guillaumebrunerie","id":787865,"avatar_url":"https://avatars.githubusercontent.com/u/787865?v=3","gravatar_id":"","url":"https://api.github.com/users/guillaumebrunerie","html_url":"https://github.com/guillaumebrunerie","followers_url":"https://api.github.com/users/guillaumebrunerie/followers","following_url":"https://api.github.com/users/guillaumebrunerie/following{/other_user}","gists_url":"https://api.github.com/users/guillaumebrunerie/gists{/gist_id}","starred_url":"https://api.github.com/users/guillaumebrunerie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guillaumebrunerie/subscriptions","organizations_url":"https://api.github.com/users/guillaumebrunerie/orgs","repos_url":"https://api.github.com/users/guillaumebrunerie/repos","events_url":"https://api.github.com/users/guillaumebrunerie/events{/privacy}","received_events_url":"https://api.github.com/users/guillaumebrunerie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-09-17T16:49:18Z","updated_at":"2015-10-14T10:00:18Z","closed_at":null,"body":"Rewrite rules do not work as I expect in parametrized modules:\r\n\r\n```agda\r\n{-# OPTIONS --rewriting #-}\r\n\r\ndata _==_ {A : Set} (a : A) : A → Set where\r\n  idp : a == a\r\n{-# BUILTIN REWRITE _==_ #-}\r\n\r\npostulate\r\n  A B : Set\r\n  f g : A → B\r\n\r\nmodule M (x : A) where\r\n\r\n  postulate\r\n    rx : f x == g x\r\n  {-# REWRITE rx #-}\r\n\r\n  -- Works, but I don’t think it should\r\n  test : (y : A) → f y == g y\r\n  test y = idp\r\n```"},"comment":{"url":"https://api.github.com/repos/agda/agda/issues/comments/147997589","html_url":"https://github.com/agda/agda/issues/1652#issuecomment-147997589","issue_url":"https://api.github.com/repos/agda/agda/issues/1652","id":147997589,"user":{"login":"jespercockx","id":2910371,"avatar_url":"https://avatars.githubusercontent.com/u/2910371?v=3","gravatar_id":"","url":"https://api.github.com/users/jespercockx","html_url":"https://github.com/jespercockx","followers_url":"https://api.github.com/users/jespercockx/followers","following_url":"https://api.github.com/users/jespercockx/following{/other_user}","gists_url":"https://api.github.com/users/jespercockx/gists{/gist_id}","starred_url":"https://api.github.com/users/jespercockx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jespercockx/subscriptions","organizations_url":"https://api.github.com/users/jespercockx/orgs","repos_url":"https://api.github.com/users/jespercockx/repos","events_url":"https://api.github.com/users/jespercockx/events{/privacy}","received_events_url":"https://api.github.com/users/jespercockx/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T10:00:18Z","updated_at":"2015-10-14T10:00:18Z","body":"The similarity of this problem for rewrite rules and for instance arguments has made me think: wouldn't it be better if we used the instance search mechanism for rewrite rules? Instead of defining an element of the rewrite relation and then marking it as a rewrite rule, you could just mark the definition as an instance. I think this would fit quite nicely and reduce the cost of implementing new features for instance arguments/rewriting by a lot."}}