Using with to Compose Uncertain Structures
Let’s learn how to use the with function to help us in carrying out pattern matching.
We'll cover the following...
The logic of using with
The philosophy of with
is simple. It allows us to specify pattern matches at each step of composition:
-
If the match succeeds, the composition proceeds.
-
If it fails, the composition halts and falls through to an
else
condition.
Here’s an example ...