© Kit Eason 2018
Kit EasonStylish F#https://doi.org/10.1007/978-1-4842-4000-7_6

6. Pattern Matching

Kit Eason1 
(1)
Farnham, Surrey, UK
 

We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves.

—Ada Lovelace, Computer Pioneer

Weaving Software with Patterns

I have many “favorite” F# features, but my favorite favorite is pattern matching! Perhaps this is because it’s the feature that takes us furthest away from Object Oriented coding, letting us truly differentiate from legacy coding patterns. Another nice aspect is how unexpectedly pervasive it can be in well-factored codebases. Prepare to be surprised at the places where you can use pattern matching to simplify and beautify ...

Get Stylish F#: Crafting Elegant Functional Code for .NET and .NET Core now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.