Pattern matching is a syntactic way of deconstructing product and sum types to get at their inhabitants.
With respect to products, pattern matching gives you the means for destructuring and exposing the contents of products, binding one or more values contained therein to names.
With sums, pattern matching lets you discriminate which inhabitant of a sum you mean to handle in that match.
Pattern matching is a syntactic way of deconstructing product and sum types to get at their inhabitants.
With respect to products, pattern matching gives you the means for destructuring and exposing the contents of products, binding one or more values contained therein to names.
With sums, pattern matching lets you discriminate which inhabitant of a sum you mean to handle in that match.