Advertisement

Stylish F# pp 119-155 | Cite as

Pattern Matching

  • Kit Eason
Chapter

Abstract

In this chapter we discuss the many locations in F# code where we can use pattern matching. We can pattern match explicitly using the match keyword, but also in let bindings, loops, lambdas, and function declarations. Active Patterns add a whole new layer of power, letting you map from somewhat open-ended data to much more strongly-typed classifications. We also note that pattern matching can be overdone, leading to unreadable code. We establish some criteria to help decide when to use the various pattern matching features.

Copyright information

© Kit Eason 2018

Authors and Affiliations

  • Kit Eason
    • 1
  1. 1.Farnham, SurreyUK

Personalised recommendations