Here's an example of them working together rather effortlessly:
using Unitful, IntervalArithmetic
const m = u"m"
const k = 2π/10m
f(x) = cos(k * x)/(k^2 - 1/x^2)
julia> f((10.0 ± 0.1)m)
[2.5924, 2.60024] m^2
If I try to put in a dimensionally incorrect argument to f, I get an error:
julia> f((10 ± 0.01)u"s")
ERROR: MethodError: no method matching cos(::Quantity{Interval{Float64},𝐓*𝐋^-1,Unitful.FreeUnits{(m^-1, s),𝐓*𝐋^-1,nothing}})
Closest candidates are:
cos(::Float16) at math.jl:1085
cos(::Complex{Float16}) at math.jl:1086
cos(::Missing) at math.jl:1138
...
This isn't the most friendly error message in the world, but that can certainly be worked on and with a bit of patience it's pretty clear that it's saying that the problem was that it tried to compute the cosine of a unitful quantity which is nonsense.
_____________________________________
Unfortunately I had to use unitful intervals (i.e. (10.0 ± 0.1)m) instead of intervals of uniful quantities (i.e. 10.0m ± 0.1m) because IntervalArithmetic.jl demands that it takes real quantities, but Unitful quantities are subtypes of Number instead of Real.
_____________________________________
Unfortunately I had to use unitful intervals (i.e. (10.0 ± 0.1)m) instead of intervals of uniful quantities (i.e. 10.0m ± 0.1m) because IntervalArithmetic.jl demands that it takes real quantities, but Unitful quantities are subtypes of Number instead of Real.