Composable Scala Matchers

Introduction

When people ask me what are the most important differences between functional programming and other paradigms of programming, I say functional composition, pattern matching and non-strict (lazy) evaluation. Lots of languages have lambdas, and functional languages have lots of other good stuff. But the three features I mention are, to me at least, the essence of functional programming.

Pattern matching is a truly awesome feature and I like to describe patterns, jokingly, as the “dark” side of expressions. The yin of the expression’s yang. But, however powerful and convenient such patterns are, they are not easily…


Logging can, unfortunately, be either a blessing or a curse. For production systems, logging is a discipline all of its own. But often, it seems, it’s not used as much as it could be in code development. It should be so simple that it’s the first, not the last, resort when trying to understand why code is not working as expected. And nowhere is this more true than in functional programming languages. That’s because logging is, well, statement-oriented rather than expression-oriented. Even if you don’t bother with logging, but use println instead, you will still have to wrestle with your…

Robin Hillyard

I’ve been addicted to programming for over 50 years now. I currently teach two classes to graduates at Northeastern University, Boston, USA.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store