04 Pattern Matching with Variants (Part 2)

Let's improve our code from last time.

We can actually nest our pattern matching, so that we don't need to match several times.

Nesting pattern matching can really help clean up your code. Let's add another shape!

Uh oh! We have a warning! Our center function is missing a pattern match for our newly created Point constructor. Let's fix that.

Note that we couldn't use Point _ here, because we need to capture the data held by the point. We could; however, write Point (x, y) -> (x, y), but we're doing extra pattern matching that we don't actually need to do if we do that.