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

Use Infinity.jl for representing Bounded vs Unbounded intervals #216

Open
rofinn opened this issue Apr 16, 2023 · 1 comment
Open

Use Infinity.jl for representing Bounded vs Unbounded intervals #216

rofinn opened this issue Apr 16, 2023 · 1 comment
Milestone

Comments

@rofinn
Copy link
Member

rofinn commented Apr 16, 2023

Pros:

  1. Reduces the number of custom types we need to maintain in this package
  2. We can rely on most of the existing logic and conversion in Infinity.jl (or eventually Infinities.jl) to handle most of our logic
  3. Having endpoints map to ::Union{T, Infinity} seems a bit more intuitive to me... as we often use Union{T, Missing} or Union{T, Nothing} in other similar contexts?

Cons:

  1. This would increase the size of the interval type as we'd be storing an extra bool for each endpoint
  2. We're depending on another external package which users must learn and switching from Infinity.jl to Infinities.jl would likely be another breaking change.
@rofinn
Copy link
Member Author

rofinn commented Apr 17, 2023

In retrospect we could probably just drop the endpoint logic in favour of.

  1. Having a constructor which promotes left and right endpoints of different types.
  2. Assuming basic functions like isless, isequal, or isfinite exist for the element type.

In the end this should make it easier for us to align Intervals.jl with IntervalSets.jl which doesn't have an explicit concept of bound vs unbounded intervals.

@rofinn rofinn added this to the Intervals 2.0 milestone Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant