Matches a Resource with a pattern, returning a value.
The Resource to match.
Pattern object with functions for each state.
Matches a Resource with a pattern, returning a value.