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

Bind Julia types to AttrTypes when declaring the ACSet type #119

Closed
kris-brown opened this issue Feb 28, 2024 · 0 comments · Fixed by #120
Closed

Bind Julia types to AttrTypes when declaring the ACSet type #119

kris-brown opened this issue Feb 28, 2024 · 0 comments · Fixed by #120
Assignees
Labels
enhancement New feature or request

Comments

@kris-brown
Copy link
Collaborator

Normally when we have attribute types we first declare an "AbsMytype" and then const a type with the Julia types instantiated.

SchLabeledSet = BasicSchema([:X], [], [:Label], [(:label,:X,:Label)])
@acset_type AbsLabeledSet(SchLabeledSet)
const LabeledSet = AbsLabeledSet{Symbol}

However often we make the schema with a particular type in mind ("of course my labels will be symbols, not some arbitrary Julia type"). We don't ever think about AbsLabeledSet. A user-friendly syntax would be

SchLabeledSet = BasicSchema([:X], [], [:Label], [(:label,:X,:Label)])
@acset_type LabeledSet(SchLabeledSet){Symbol}

The @acset_type macro would need a small tweak to handle this case.

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