Search⌘ K

Recursive Functions

Explore how recursive functions work in ReasonML and understand the role of the rec keyword to enable self-calling functions. Learn to define base cases and implement algorithms such as the Fibonacci sequence, enhancing your functional programming skills.

We'll cover the following...

Definition

Recursion is the process in which a function calls itself during runtime. It stops at the base case. The base case is a check which specifies the final level of recursion.

We can think of recursion as boxes within boxes, with each recursive call being a box. Recursion grows in a nested manner, and always reduces back to the original call.

For more on the ...