Back to Developer Roadmap

Trampolines

src/data/roadmaps/scala/content/trampolines@VV-Drj_JlIppItHq4PRFc.md

4.0620 B
Original Source

Trampolines

Trampolines in Scala are used to avoid stack overflow errors in deep recursion by moving the computation from the stack to the heap. The TailRec class is part of the scala.util.control.TailCalls are used to implement trampolining.

Visit the following resources to learn more: