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

@instance macro should be able to take named type parameters, not just an ordered list #192

Closed
kris-brown opened this issue Jan 27, 2025 · 0 comments · Fixed by #193
Closed
Labels
enhancement New feature or request

Comments

@kris-brown
Copy link
Collaborator

When one makes an instance of a theory, one must provide Julia types for each sort of the theory. The sorts are ordered, so one need not provide these via key-value pairs. However, when there are many such types, it becomes hard to remember the order when writing the code (and likewise it's very hard to understand what is going on when reading the code weeks later).

To solve this, @instance ought be able to parse pairs and implicitly generate the correctly-ordered list of types, throwing an error if there are missing or superfluous keys. For example:

@instance ThCategory{Ob=Int, Hom=Vector{Int}} [model::FinSetC] begin 
  ...
end

This is at odds with type constructor name overloading, but I'm pretty sure there are other places where actually doing that kind of overloading would lead to errors.

@kris-brown kris-brown added the enhancement New feature or request label Jan 27, 2025
@kris-brown kris-brown linked a pull request Jan 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant