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

BoundingBox.Interval could have fixed-length version #9

Open
vreuter opened this issue Sep 24, 2024 · 0 comments
Open

BoundingBox.Interval could have fixed-length version #9

vreuter opened this issue Sep 24, 2024 · 0 comments
Labels
enhancement New feature or request hard refactor

Comments

@vreuter
Copy link
Contributor

vreuter commented Sep 24, 2024

A new interval type could be constructed, accepting an additional type parameter which would be a subtype of Singleton, and for which we may required a Numeric instance (or something similar from spire). Each value of such an interval type would then have its length encoded at the type level, which would facilitate defining total functions for operations which we only wish to define for same-length intervals (e.g. adding, averaging, etc.). Rather than having a runtime check on interval length equality, the operation would only be defined for operands (intervals) for which the equality of length was statically guaranteed/proven.

@vreuter vreuter added enhancement New feature or request refactor hard labels Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hard refactor
Projects
None yet
Development

No branches or pull requests

1 participant