As discussed above, recursion follows an if-else pattern. We can also implement recursive functions using match. The basic concept is exactly the same as before. There is a base case which is handled by the first case. The second case handles the recursive call. It is exactly like if-else with the first case representing if and the second case representing else.