Error
Error when matching.
Type parameters
- R
-
the result-type of this.
Value parameters
- e
-
the exception that was thrown.
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
Composition method. If this MatchResult is successful then return the value of m applied to the result.
Composition method. If this MatchResult is successful then return the value of m applied to the result.
Type parameters
- S
-
the underlying type of the input to m (S is a super-class of R).
- U
-
the underlying type of the returned value.
Value parameters
- m
-
a Matcher of S to T.
Attributes
- Returns
-
a MatchResult[T].
Type parameters
- S
-
the underlying type of s.
Value parameters
- sm
-
a MatchResult[S] (ignored).
Attributes
- Returns
-
Error(t).
Type parameters
- S
-
the underlying type of the returned MatchResult.
Value parameters
- f
-
a function of R => MatchResult[S].
Attributes
- Returns
-
Error(e).
Method to get the value of this MatchResult, otherwise return the parameter s.
Method to get the value of this MatchResult, otherwise return the parameter s.
Type parameters
- S
-
a super-class of R.
Value parameters
- s
-
a call-by-name value to be used if this is unsuccessful.
Attributes
- Throws
-
Throwable
e
Method to compose this MatchResult with sm. It this is successful, then sm will be returned. Otherwise, an Unsuccessful result will be returned.
Method to compose this MatchResult with sm. It this is successful, then sm will be returned. Otherwise, an Unsuccessful result will be returned.
Type parameters
- S
-
the type of the resulting MatchResult.
Value parameters
- sm
-
the MatchResult that must follow this MatchResult for a successful outcome.
Attributes
- Returns
-
a MatchResult[S].
Identifies the current MatchResult with the given string.
Identifies the current MatchResult with the given string.
Value parameters
- w
-
a string value used for identification
Attributes
- Returns
-
the current
MatchResult[R]
Returns the inversion of this MatchResult.
Returns the inversion of this MatchResult.
Attributes
- Returns
-
the current
MatchResult.
Type parameters
- S
-
the underlying type of the returned MatchResult.
Value parameters
- f
-
a function of R => S (ignored)
Attributes
- Returns
-
Error(e).
- Definition Classes
Alternation method that takes a MatchResult as the alternative.
Alternation method that takes a MatchResult as the alternative.
Type parameters
- S
-
the underlying type of the result and a super-class of R.
Value parameters
- sm
-
a MatchResult that will be ignored.
Attributes
- Returns
-
sm.
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
-
Any
Alternation method that takes a Matcher as the alternative. If this MatchResult is empty, then return the value of m applied to the input.
Alternation method that takes a Matcher as the alternative. If this MatchResult is empty, then return the value of m applied to the input.
Value parameters
- m
-
a Matcher of Any to R.
Attributes
- Returns
-
m(t).
Inherited methods
Method to compose this MatchResult with sm. It this is successful, then sm will be returned. Otherwise, an Unsuccessful result will be returned.
Method to compose this MatchResult with sm. It this is successful, then sm will be returned. Otherwise, an Unsuccessful result will be returned.
Similar to ~ except that this MatchResult[R] is discarded and not part of the result. In other words, this acts purely as a guard. This method simply invokes guard(sm).
Type parameters
- S
-
the type of the resulting MatchResult.
Value parameters
- sm
-
the MatchResult that must follow this MatchResult for a successful outcome.
Attributes
- Returns
-
a MatchResult[S] which is the result of calling guard(sm).
- Inherited from:
- MatchResult
Method to accumulate this MatchResult[R] with a MatchResult[S], given a function which can combine the wrapped elements.
Method to accumulate this MatchResult[R] with a MatchResult[S], given a function which can combine the wrapped elements.
Type parameters
- S
-
the underlying type of sm.
- U
-
the underlying type of the result, which is a super-class of R.
Value parameters
- accumulator
-
a function of type (R, S) => U.
- sm
-
a MatchResult[S].
Attributes
- Returns
-
a MatchResult[U].
- Inherited from:
- MatchResult
Method to combine this MatchResult[R] with a MatchResult[S], given a function which can combine the wrapped elements.
Method to combine this MatchResult[R] with a MatchResult[S], given a function which can combine the wrapped elements.
Type parameters
- S
-
the underlying type of sm.
Value parameters
- combiner
-
a function of type (R, S) => U.
- sm
-
a MatchResult[U].
Attributes
- Returns
-
a MatchResult[U].
- Inherited from:
- MatchResult
Filters this MatchResult with the provided predicate.
Filters this MatchResult with the provided predicate.
If this is a Miss, then it is returned as is. If this is a Match, and the given predicate p is applied to its value. If the result of applying the predicate is true, then this Match is returned. Otherwise, this method returns a Miss.
Value parameters
- p
-
A predicate function that takes a value of type
Rand returns aBoolean.
Attributes
- Returns
-
A
MatchResult[R]which is either the current instance if the predicate matches, or aMiss. - Inherited from:
- MatchResult
Filters the current MatchResult (if successful) with the provided predicate. If the predicate evaluates to false for the result of this MatchResult, the current instance is returned. Otherwise, it returns a Miss. If this is a Miss then that is returned.
Filters the current MatchResult (if successful) with the provided predicate. If the predicate evaluates to false for the result of this MatchResult, the current instance is returned. Otherwise, it returns a Miss. If this is a Miss then that is returned.
Value parameters
- p
-
A predicate function that takes a value of type
Rand returns aBoolean.
Attributes
- Returns
-
A
MatchResult[R]which is either the current instance if the predicate matches, or aMiss. - Inherited from:
- MatchResult
Do nothing.
Do nothing.
Value parameters
- f
-
a function of R => Unit (ignored).
Attributes
- Inherited from:
- Unsuccessful
get method (will always throw an exception).
get method (will always throw an exception).
Attributes
- Throws
-
Throwable
(a MatcherException) or other Throwable (e).
- Inherited from:
- Unsuccessful
Method to determine if this is unsuccessful.
Method to determine if this is unsuccessful.
Attributes
- Returns
-
the negation of successful.
- Inherited from:
- MatchResult
An iterator over the names of all the elements of this product.
An iterator over the names of all the elements of this product.
Attributes
- Inherited from:
- Product
An iterator over all the elements of this product.
An iterator over all the elements of this product.
Attributes
- Returns
-
in the default implementation, an
Iterator[Any] - Inherited from:
- Product
"unit" method for a successful match.
"unit" method for a successful match.
Type parameters
- S
-
the underlying type of the result.
Value parameters
- s
-
the call-by-name value of the result.
Attributes
- Returns
-
a Match[S] with value s (unless s throws an exception, in which case the result will be an Error).
- Inherited from:
- MatchResult
Attributes
- Returns
-
false.
- Inherited from:
- Unsuccessful
Alternation method that takes a MatchResult as the alternative. Identical to orElse.
Alternation method that takes a MatchResult as the alternative. Identical to orElse.
Type parameters
- S
-
the type of the result and a super-type of R.
Value parameters
- sm
-
a call-by-name MatchResult that will be used if this is empty.
Attributes
- Returns
-
a MatchResult[S] which is the result of invoking orElse(sm).
- Inherited from:
- MatchResult
Method to compose this MatchResult with sm. The results of this and of sm are combined into one ~. ~ is a synonym of andThen.
Method to compose this MatchResult with sm. The results of this and of sm are combined into one ~. ~ is a synonym of andThen.
Type parameters
- S
-
the underlying type of s.
Value parameters
- sm
-
a call-by-name MatchResult[S].
Attributes
- Returns
-
a MatchResult[R ~ S].
- Inherited from:
- MatchResult
Method to compose this MatchResult with sm. If either this is a Match or sm is a Match, the result will be a Match. CONSIDER having two nested match clauses such that sm would not be evaluated if this was an Error.
Method to compose this MatchResult with sm. If either this is a Match or sm is a Match, the result will be a Match. CONSIDER having two nested match clauses such that sm would not be evaluated if this was an Error.
Type parameters
- S
-
the underlying type of s.
Value parameters
- sm
-
a call-by-name MatchResult[S].
Attributes
- Returns
-
a MatchResult[R ~ S].
- Inherited from:
- MatchResult