O'Reilly logo

Scala Functional Programming Patterns by Atul S. Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

You learned about recursion and problems that are by nature, recursive. For example, directories on a Linux filesystem are defined this way. You also learned about recursive solutions, the general case, and the essential base case. The base case is needed so that the process eventually gets terminates. We also looked at Scala's slice and dice technique and how to split the list so that we can visit each element. We saw how recursive calls and associated context are remembered on stack frames and the need for tail recursion. We saw examples where tail recursion enables TCO. We looked at a detail example of a small expression parser. We looked at how recursive code promotes immutability, as we did not use var in our code. We looked at persistent ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required