Background
Now the discrete range trait doesn't seem clean because of the following issue:
- No bound check, the
next_value and previous_value requires always returns a value
- Unknown number of distinct values
- Linspace coord should be a discrete range, however this can't be used in
Histogram since the hash table requires Equal trait but f64 doesn't impl the trait.
However, all the discrete range is equivalent to a integer range, thus we doesn't actually need put any restriction on the traits for the actual values. (Later we may use an array as an discrete coordinate and lifting the trait bound will make this possible)
Drawbacks
In order to know the number of values and handle the bound correctly, we have to make most of the RangeParam not an unit type, and this will makes Histogram::new unsable to applied to most of the coord types. Thus this should be considered as an breaking change.
Background
Now the discrete range trait doesn't seem clean because of the following issue:
next_valueandprevious_valuerequires always returns a valueHistogramsince the hash table requiresEqualtrait butf64doesn't impl the trait.However, all the discrete range is equivalent to a integer range, thus we doesn't actually need put any restriction on the traits for the actual values. (Later we may use an array as an discrete coordinate and lifting the trait bound will make this possible)
Drawbacks
In order to know the number of values and handle the bound correctly, we have to make most of the
RangeParamnot an unit type, and this will makesHistogram::newunsable to applied to most of the coord types. Thus this should be considered as an breaking change.