Pattern Matching

  • David Pollak


So far, we’ve explored some of the basic functional cornerstones of Scala: immutable data types and the passing of functions as parameters. The third cornerstone of functional programming is pattern matching. At first glance, pattern matching looks like Java’s switch statement. However, pattern matching provides a powerful tool for declaring business logic in a concise and maintainable way. Scala blends traditional functional programming pattern matching with object-oriented concepts to provide a very powerful mechanism for writing programs.


Case Class Pattern Match Partial Function Data Hiding Scala Code 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© David Pollak 2009

Authors and Affiliations

  • David Pollak

There are no affiliations available

Personalised recommendations