# Type inference: map + accumulate tuple recursively

**URL:** <https://discourse.julialang.org/t/type-inference-map-accumulate-tuple-recursively/17648>\
**Category:** General Usage\
**Tags:** question\
**Created:** [November 17, 2018, 4:05pm UTC](https://discourse.julialang.org/t/type-inference-map-accumulate-tuple-recursively/17648 "2018-11-17T16:05:07Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [November 17, 2018, 5:27pm UTC](https://discourse.julialang.org/t/type-inference-map-accumulate-tuple-recursively/17648/4 "2018-11-17T17:27:13Z")

</div>

I’m guessing because in the second version it’s easier for the compiler to prove that the recursion is finite.

This reminded me of Jameson’s post here: [Efficient tuple concatenation - #8 by jameson](https://discourse.julialang.org/t/efficient-tuple-concatenation/5398/8) and explanation here: [Efficient tuple concatenation - #11 by jameson](https://discourse.julialang.org/t/efficient-tuple-concatenation/5398/11)

> [@Efficient tuple concatenation](https://discourse.julialang.org/t/efficient-tuple-concatenation/5398/11):
>
> It doesn’t call itself recursively on new values, only existing ones. This allows inference to trivially prove that it won’t need to solve the halting problem in order to do constant propagation.

---

_[View the full topic](https://discourse.julialang.org/t/type-inference-map-accumulate-tuple-recursively/17648)._
