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

Runtime check for valid models #91

Open
kris-brown opened this issue Sep 8, 2023 · 0 comments
Open

Runtime check for valid models #91

kris-brown opened this issue Sep 8, 2023 · 0 comments

Comments

@kris-brown
Copy link
Collaborator

For example, slice categories:

struct SliceC{ObT, HomT, C<:Model{Tuple{ObT, HomT}}} <: Model{Tuple{SliceOb{ObT, HomT}, HomT}}
  cat::C
  over::ObT
end

@instance ThCategory{SliceOb{ObT, HomT}, HomT} (;model::SliceC{ObT, HomT, C}) where {ObT, HomT, C} begin
...

We want to constrain the C of SliceC to be a type which is not just a Model but a model which implements ThCategory. However, we can only know at runtime if this is the case.

So there should be an overloadable is_valid_instance() method in the @instance declaration that will make calls to implements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant