Closed dlfivefifty closed 5 years ago
In general I'd say the fewer type parameters the better. T
is essential but the others aren't really. One could conceivably make a generic interval where open/closed is stored as a boolean. An advantage would be that collections of intervals that can be open or closed are type stable. For example, a subdivision of a closed interval into smaller intervals could have open intervals in the interior, and two halfopen intervals at either end.
Alternatively, there could be an additional abstract type `TypeStableEndpointsInterval{L,R,T} <: AbstractInterval{T}' (with a better name)?
Happy with TypedEndpointInterval
?
Very :-)
This was added to IntervalSets.jl
:open
,:closed
should apply to any interval, so I don't see why this wouldn't be part ofAbstractInterval
.