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

In this chapter, we looked at two very important concepts in Scala, namely pattern matching and partial functions. We saw many examples where pattern matching comes handy, and its application to get the double dispatch works for us. We implemented the chain of responsibilities design pattern in Java. Partial functions are a very useful concept in their own right, and we saw how to implement the chain of responsibilities using partial functions in Scala. Along the way, we looked at the collect functions. The stage is set now for you to get into the thick of functional programming. We have already briefly touched upon the theme of composition and how to create a pipeline. In the upcoming chapter, we will see various functional combinators ...

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