Base.minmax is almost the same, and IntervalSets.ordered is not used in IntervalSets.jl itself.
julia> using IntervalSets
julia> ordered(1,2)
(1, 2)
julia> minmax(1,2)
(1, 2)
julia> ordered(1.0,2)
(1.0, 2.0)
julia> minmax(1.0,2)
(1.0, 2.0)
julia> ordered("bc","ade")
("ade", "bc")
julia> minmax("bc","ade")
("ade", "bc")
The only differences are type promotion and if-statement.
julia> ordered([2.0], [1,3])
([1.0, 3.0], [2.0])
julia> minmax([2.0], [1,3]) # does not promote
([1, 3], [2.0])
IntervalSets.ordered uses ifelse.
https://github.com/JuliaMath/IntervalSets.jl/blob/master/src/IntervalSets.jl#L68
But Base.minmax uses ternary operator _?_:_
https://github.com/JuliaLang/julia/blob/8922eaa5517536eb51eb542f4543a8c6b82fda34/base/operators.jl#L514
I'm not sure which implementation is ideal, but Base.minmax should be fixed if IntervalSets.ordered wins in some aspect, and I think we don't have to provide our ordered function.
Base.minmaxis almost the same, andIntervalSets.orderedis not used in IntervalSets.jl itself.The only differences are type promotion and if-statement.
IntervalSets.orderedusesifelse.https://github.com/JuliaMath/IntervalSets.jl/blob/master/src/IntervalSets.jl#L68
But
Base.minmaxuses ternary operator_?_:_https://github.com/JuliaLang/julia/blob/8922eaa5517536eb51eb542f4543a8c6b82fda34/base/operators.jl#L514
I'm not sure which implementation is ideal, but
Base.minmaxshould be fixed ifIntervalSets.orderedwins in some aspect, and I think we don't have to provide ourorderedfunction.