# ∞ name collision

**URL:** https://discourse.julialang.org/t/name-collision/55033
**Category:** Tooling
**Created:** [February 10, 2021, 11:07pm UTC](https://discourse.julialang.org/t/name-collision/55033 "2021-02-10T23:07:23Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)
#### Post date: [February 10, 2021, 11:07pm UTC](https://discourse.julialang.org/t/name-collision/55033/1 "2021-02-10T23:07:23Z")

</div>

[MeasureTheory.jl](https://github.com/cscherrer/MeasureTheory.jl) currently has [InfiniteArrays.jl](https://github.com/JuliaArrays/InfiniteArrays.jl) as a dependency, because @dlfivefifty has some nice utilities for dealing with infinity as an integer value. This makes it handy for representing things like the support of a Poisson measure (we can write `ℤ[0:∞]`). Here’s the code we depend on.

[https://github.com/JuliaArrays/InfiniteArrays.jl/blob/master/src/Infinity.jl](https://github.com/JuliaArrays/InfiniteArrays.jl/blob/master/src/Infinity.jl)

But this has some issues,

- We’re bringing in a lot of other code from InfiniteArrays we’re not currently using, and
- The name `∞` collides with an export from @Tamas_Papp 's [TransformVariables.jl](https://github.com/tpapp/TransformVariables.jl), which we also rely on heavily.

The obvious solution is to have an `Infinity.jl` the “owns” the name and has some sensible properties, and have everything depend on that. But there’s already such a library! Here’s [Infinity.jl](https://github.com/cjdoris/Infinity.jl) from @cjdoris .

But that doesn’t quite solve it, because here the standard is `∞ <: Real`.

So, my hope is that there might be a way to include all of the “infinity functionality” in Infinity.jl. Then everything that needs ∞ can depend on this one package.

Do you think this can work out?

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [February 10, 2021, 11:23pm UTC](https://discourse.julialang.org/t/name-collision/55033/2 "2021-02-10T23:23:12Z")

</div>

The plan is to combine the two approaches in

> **[GitHub - JuliaMath/Infinities.jl: A Julia package for representing infinity...](https://github.com/JuliaMath/Infinities.jl)**
>
> A Julia package for representing infinity in all its forms - GitHub - JuliaMath/Infinities.jl: A Julia package for representing infinity in all its forms

So `InfiniteArrays.Infinity` becomes `Infinities.InfiniteCardinality` and `∞` becomes more of a catch-all.

Actually this is mostly completed and just needs to be tagged and tested. I can do this shortly to start the process. If you have any opinions on the design please file issues

---

<div class="post-metadata">

### Author: ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)
#### Post date: [February 10, 2021, 11:47pm UTC](https://discourse.julialang.org/t/name-collision/55033/3 "2021-02-10T23:47:54Z")

</div>

Thanks @dlfivefifty for the quick response. Looks like you’re way ahead of me 🙂

> [@dlfivefifty](#):
>
> If you have any opinions on the design please file issues

Thanks. Right now my biggest concern is with ongoing collisions between Infinity.jl and Infinities.jl. I can just choose one, but others might choose a different one, and suddenly our packages don’t work well together. Do you see any fundamental incompatibilities with Infinity.jl? Packages like this are relatively small, but small packages with commonly-needed concepts can end up with hundreds of dependencies over time.

Do these packages have any big differences in their goals or technical approach?

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [February 11, 2021, 7:32am UTC](https://discourse.julialang.org/t/name-collision/55033/4 "2021-02-11T07:32:57Z")

</div>

I designed Infinities.jl in conjunction with the creator of Infinity.jl as a complete replacement, so someone just needs to add the remaining features from Infinity.jl to Infinities.jl and change the dependencies.

In the meantime, just use `import` instead of `using` to avoid clashes

---

<div class="post-metadata">

### Author: ![cjdoris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cjdoris/32/213133_2.png) [@cjdoris](https://discourse.julialang.org/u/cjdoris)
#### Post date: [February 11, 2021, 10:15am UTC](https://discourse.julialang.org/t/name-collision/55033/5 "2021-02-11T10:15:00Z")

</div>

Hi, author of `Infinity.jl` here. Yes, use `Infinities.jl` instead.

I’ve been too distracted lately by other projects, but I’ll try to make some time to port all the functionality over soon. Contributors from packages dependent on mine have very kindly ensured it has 100% test coverage, so I’d like to replicate that here.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [February 11, 2021, 10:50am UTC](https://discourse.julialang.org/t/name-collision/55033/6 "2021-02-11T10:50:41Z")

</div>

`Infinities.RealInfinity` would allow me to replace `∞` in `TransformVariables`, but I don’t quite see the point of `Infinities.Infinity` — I would just treat it as a special case of `Infinities.RealInfinity`, and use `∞`.

This has the advantage of `-∞` not changing type. Should I open an issue about this?

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [February 11, 2021, 11:52am UTC](https://discourse.julialang.org/t/name-collision/55033/7 "2021-02-11T11:52:31Z")

</div>

No this was thought through and discussed, see project plan, there’s a need for positive infinity.

I got inspired and got the codecov to 💯 and have now registered the package. So v0.0.1 will be available in 3 days

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [February 11, 2021, 1:02pm UTC](https://discourse.julialang.org/t/name-collision/55033/8 "2021-02-11T13:02:46Z")

</div>

It is not clear to me from the project plan why `Infinities.Infinity` is replacing `Infinity.Infinity`, not `RealInfinity(true)`.

That said, what I really need for TransformVariables is a distinct _positive_ and _negative_ “infinity” type, ideally available with `∞` and `-∞`, that I can dispatch on so that `TransformVariables.as` is type stable.

---

<div class="post-metadata">

### Author: ![dlfivefifty](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dlfivefifty/32/1959_2.png) [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)
#### Post date: [February 11, 2021, 1:10pm UTC](https://discourse.julialang.org/t/name-collision/55033/9 "2021-02-11T13:10:33Z")

</div>

Please file an issue if you want to discuss further. I believe @cjdoris had a need for a positive real infinity called `∞`. I personally only need `InfiniteCardinal` and so would be OK with `const ∞ = RealInfinity()`.

---

<div class="post-metadata">

### Author: ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)
#### Post date: [February 11, 2021, 1:26pm UTC](https://discourse.julialang.org/t/name-collision/55033/10 "2021-02-11T13:26:11Z")

</div>

+1  
Many have needed a positively signed infinity and a negatively signed infinity that were distinctly subtyped from shared abstraction. I am opening an issue at Infinities.jl, please contribute your perspective.

---

<div class="post-metadata">

### Author: ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)
#### Post date: [February 11, 2021, 1:38pm UTC](https://discourse.julialang.org/t/name-collision/55033/11 "2021-02-11T13:38:55Z")

</div>

Thanks, done.

[https://github.com/JuliaMath/Infinities.jl/issues/5](https://github.com/JuliaMath/Infinities.jl/issues/5)

---

<div class="post-metadata">

### Author: ![cscherrer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cscherrer/32/7631_2.png) [@cscherrer](https://discourse.julialang.org/u/cscherrer)
#### Post date: [February 11, 2021, 2:45pm UTC](https://discourse.julialang.org/t/name-collision/55033/12 "2021-02-11T14:45:24Z")

</div>

It’s exciting to see this moving forward! Thanks all.

---

<div class="post-metadata">

### Author: ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)
#### Post date: [February 11, 2021, 3:57pm UTC](https://discourse.julialang.org/t/name-collision/55033/13 "2021-02-11T15:57:33Z")

</div>

open for comment

[https://github.com/JuliaMath/Infinities.jl/issues/6](https://github.com/JuliaMath/Infinities.jl/issues/6)
