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

Elab issues with index notation #22

Open
lecopivo opened this issue Mar 8, 2024 · 1 comment
Open

Elab issues with index notation #22

lecopivo opened this issue Mar 8, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@lecopivo
Copy link
Contributor

lecopivo commented Mar 8, 2024

I broke the element access notation again

variable {Cont Idx Elem} [IndexType Idx] [Indexed Cont Idx Elem]

variable (x y : Cont)

-- broken
#check Function.HasUncurry.uncurry fun i => x[i]
#check Function.HasUncurry.uncurry fun i j => (x[i],y[j])

-- works
#check Function.HasUncurry.uncurry fun i => (x[i] : Elem)
#check Function.HasUncurry.uncurry fun i j => ((x[i] : Elem),(y[j] : Elem))

Because the x[i] elaboration is postponed until the type of x[i] is known it causes failure to synthesize the instance in HasUncurry.

I'm thinking of going back to using GetElem.getElem instead of Indexed.get. Then the custom element access notation can be implemented just as a macro and the elaboration mess can be completely avoided.

@JamesGallicchio
Copy link
Owner

hm, this makes sense; for now I think I'll remove the notation. when I want it again I'll try copying the getElem elaborator to see what it does.

@JamesGallicchio JamesGallicchio added the bug Something isn't working label Mar 8, 2024
@JamesGallicchio JamesGallicchio self-assigned this Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants