# Editing UnionAll and putting it back together

**URL:** <https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116>\
**Category:** General Usage\
**Created:** [October 20, 2019, 6:59pm UTC](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116 "2019-10-20T18:59:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [October 20, 2019, 6:59pm UTC](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116/1 "2019-10-20T18:59:38Z")

</div>

```julia
typ = Tuple{Int,T} where T<:Real
unwtyp = Base.unwrap_unionall(typ) # Tuple{Int,T<:Real}
edited = edit(unwtyp,Real,Float64) # Tuple{Int,T<:Float64}, has free type variables.

```

I want to put Tuple{Int,T\<:Float64} back to the form of Tuple{Int,T} where T\<:Float64

how can I do that?

Thanks

---

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [October 21, 2019, 11:05am UTC](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116/2 "2019-10-21T11:05:43Z")

</div>

Any answers?

---

<div class="post-metadata">

**Author:** ![chakravala](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chakravala/32/6832_2.png) [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Post date:** [October 21, 2019, 6:16pm UTC](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116/3 "2019-10-21T18:16:34Z")

</div>

your `edit` function is undefined, but this might work

```nohighlight
UnionAll(TypeVar(:T,Float64),edited)

```

---

<div class="post-metadata">

**Author:** ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)\
**Post date:** [October 21, 2019, 6:26pm UTC](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116/4 "2019-10-21T18:26:29Z")

</div>

You’re probably looking for the `rewrap_unionall` function.

---

<div class="post-metadata">

**Author:** ![Qiyamah](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/qiyamah/32/2660_2.png) [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Post date:** [October 22, 2019, 3:37pm UTC](https://discourse.julialang.org/t/editing-unionall-and-putting-it-back-together/30116/5 "2019-10-22T15:37:38Z")

</div>

> [@chakravala](#):
>
> but this might work

it doesn’t work because TypeVar(:T) == TypeVar(:T) doesn’t work. Since it is scoped variable at C runtime.  
anyhow. I figured it out.  
Thanks
