# Julia standard library for interval type

**URL:** <https://discourse.julialang.org/t/julia-standard-library-for-interval-type/60936>\
**Category:** Internals & Design\
**Created:** [May 11, 2021, 7:49am UTC](https://discourse.julialang.org/t/julia-standard-library-for-interval-type/60936 "2021-05-11T07:49:47Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [May 11, 2021, 11:51am UTC](https://discourse.julialang.org/t/julia-standard-library-for-interval-type/60936/7 "2021-05-11T11:51:42Z")

</div>

> [@TheLateKronos](#):
>
> I’m not sure what the best solution is, but I am still leaning towards that the interval-type is, to repeat myself, general and useful enough to warrant being included in the language itself. A

Current evidence suggests that it is not.  
Our idea of what an interval is and how it should act is demonstratably still evolving since we have multiple competing packages.

> **[GitHub - invenia/Intervals.jl: Non-iterable ranges](https://github.com/invenia/Intervals.jl)**
>
> Non-iterable ranges. Contribute to invenia/Intervals.jl development by creating an account on GitHub.

> **[GitHub - JuliaMath/IntervalSets.jl: Interval Sets for Julia](https://github.com/JuliaMath/IntervalSets.jl)**
>
> Interval Sets for Julia. Contribute to JuliaMath/IntervalSets.jl development by creating an account on GitHub.

> **[GitHub - JuliaIntervals/IntervalArithmetic.jl: Library for validated numerics...](https://github.com/JuliaIntervals/IntervalArithmetic.jl)**
>
> Library for validated numerics using interval arithmetic - GitHub - JuliaIntervals/IntervalArithmetic.jl: Library for validated numerics using interval arithmetic

Hopefully at some point those will converge, either to one package, or to a common shared API (like Tables.jl), but til then we need to keep them flexible.

Changing anything in a standard library is _hard_.  
You can’t make any breaking changes.  
and even adding new features is annoying since people on old versions of julia can’t benifit from them.  
Where as a package can be updated independently of the julia version.

Standard libraries are basically second class packages.  
There are to my mind 2 reasons to put things in standard library.

1. It is needed for some other part of the standard library. (e.g. we introduce some missing methods for some specialized matrix factorization, but that needs say some new method for factorizing numbers into primes or something to implement efficently.)
2. Not having it in the standard library causes people to use an inferior solution that _is_ in the standard library (a good example is `only` which is like first but also checks that there is only one element. WIthout it people will use `first` and their code will be a bit less robust to programmer mistakes)

Julia is not a language where everything you need is in the standard library (unlike say Mathematica).  
Julia is more like LaTeX: noone uses LaTeX in a nontrivial way without installing a few dozen packages.

---

_[View the full topic](https://discourse.julialang.org/t/julia-standard-library-for-interval-type/60936)._
