# Combinatorial Type Explosion: Nested Parameteric Types

**URL:** <https://discourse.julialang.org/t/combinatorial-type-explosion-nested-parameteric-types/54652>\
**Category:** Performance\
**Created:** [February 4, 2021, 9:12pm UTC](https://discourse.julialang.org/t/combinatorial-type-explosion-nested-parameteric-types/54652 "2021-02-04T21:12:29Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [February 5, 2021, 7:41pm UTC](https://discourse.julialang.org/t/combinatorial-type-explosion-nested-parameteric-types/54652/11 "2021-02-05T19:41:57Z")

</div>

> [@Deduction42](#):
>
> but it may take me a while to code the “if statement” generator.

There is one example here: [Macro to write function with many conditionals - #8 by Skoffer](https://discourse.julialang.org/t/macro-to-write-function-with-many-conditionals/51616/8)

That macro is a very instructive example, imo

> [@Deduction42](#):
>
> The reason why this “if statement” might be faster is because every type-argument going into each value-dispatched get\_density function would be known constant at compile time, allowing the compiler to just insert the functions and compile. Am I correct in saying this?

Yes, that was the original motivation of that macro by the way.

---

_[View the full topic](https://discourse.julialang.org/t/combinatorial-type-explosion-nested-parameteric-types/54652)._
