Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make with more general again? #2324

Closed
nad opened this issue Dec 1, 2016 · 4 comments
Closed

Make with more general again? #2324

nad opened this issue Dec 1, 2016 · 4 comments
Labels
parameter-refinement type: bug Issues and pull requests about actual bugs type: enhancement Issues and pull requests about possible improvements with Problems with the "with" abstraction
Milestone

Comments

@nad
Copy link
Contributor

nad commented Dec 1, 2016

Agda rejects the following code:

Type-of : {A : Set}  A  Set
Type-of {A = A} _ = A

module _ (A : Set) where

  Foo : A  Set
  Foo a with Type-of a
  ... | B = B

Error message:

Cannot `with` on variable Type-of a bound in a module telescope (or
patterns of a parent clause)
when inferring the type of Type-of a

There are two issues here:

  • Type-of a is not a variable, so the error message is misleading.
  • Shouldn't it be possible to drop this restriction now that we have parameter refinement? (The code is accepted by Agda 2.4.2. I seem to recall that this restriction was introduced by @andreasabel.)
@nad nad added type: bug Issues and pull requests about actual bugs type: enhancement Issues and pull requests about possible improvements parameter-refinement with Problems with the "with" abstraction labels Dec 1, 2016
@nad nad added this to the 2.5.2 milestone Dec 1, 2016
@andreasabel
Copy link
Member

Once we print also non-identity parameter substitutions, we can lift the restriction.
I cannot find the original issue now, but my restriction was built in to prevent errors like f != f where the first f has a different parameter instantiation than the second.

@UlfNorell
Copy link
Member

The issue Andreas couldn't find is #1342 (which could maybe do with a better title).

@andreasabel andreasabel removed this from the 2.5.2 milestone Dec 9, 2016
@asr asr added this to the 2.5.2 milestone Dec 12, 2016
@nickcollins
Copy link

nickcollins commented Feb 20, 2019

What's the status on this? I had the impression this was being worked on in 2016 but I'm having this issue today. Is there a workaround?

@UlfNorell
Copy link
Member

The discussion has moved to #1342.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
parameter-refinement type: bug Issues and pull requests about actual bugs type: enhancement Issues and pull requests about possible improvements with Problems with the "with" abstraction
Projects
None yet
Development

No branches or pull requests

5 participants