-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
Description
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.