Companion object for the Match class providing factory methods.
This object allows the creation of MatchResult instances by comparing two values of type R. If the two values are equal, a Match is constructed, and a message indicating the match result is printed to the standard error stream.
Evaluates a lazily-provided block of code and returns a MatchResult encapsulating the value if evaluation is successful. If the evaluation fails with an exception, the exception is wrapped and rethrown as a MatcherException.
Evaluates a lazily-provided block of code and returns a MatchResult encapsulating the value if evaluation is successful. If the evaluation fails with an exception, the exception is wrapped and rethrown as a MatcherException.
CONSIDER whether we should return an Error instead of throwing an exception.
Value parameters
t
The lazily-evaluated block of code whose result is to be encapsulated in a MatchResult.
Attributes
Returns
A MatchResult encapsulating the successfully evaluated value of t.