Matchers whose input is generally an Expression.
These Matchers are used to simplify (lazy) Expressions before those Expressions get evaluated, thus sometimes avoiding loss of precision.
Rules for matching: (1) All substitution is based on a successful match -- no match, no substitution; CONSIDER this second rules seems strange (2) The first match to try for any expression is the exactMaterializer which returns Match(Literal(value)); (2) Some matches return non-exact match results -- these should be passed to flatMap simplifier; NOTE: do not pass anything to flatMap simplifier if it could possibly be the same as the input (else stack overflow).
Attributes
- Companion
- object
- Graph
-
- Supertypes
- Self type
Members list
Type members
Classlikes
Abstract class ExpressionMatcher, which extends Matcher where the input type is always Expression.
Abstract class ExpressionMatcher, which extends Matcher where the input type is always Expression.
Type parameters
- R
-
the underlying type of
MatchResults.
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Inherited classlikes
Error when matching.
Error when matching.
Type parameters
- R
-
the result-type of this.
Value parameters
- e
-
the exception that was thrown.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Class to add logging to a Matcher.
Class to add logging to a Matcher.
Type parameters
- R
-
the underlying type of the result of the matcher.
- T
-
the underlying type of the input to the matcher.
Value parameters
- f
-
a function T => MatchResult[R].
- logger
-
interpreted as follows: If logger is LogOff, the Matcher instance will simply invoke function f. If logger is LogInfo, then in addition to evaluating function f, a successful match will be logged. If logger is LogDebug, then in addition to evaluating function f, the attempted match and its result will be logged.
- matcherName
-
the name to be used for this matcher.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
class Objecttrait Matchableclass Any
Successful match.
Successful match.
Type parameters
- R
-
the type of the result.
Value parameters
- r
-
the result.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Companion object for the Match class providing factory methods.
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.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
trait Producttrait Mirrorclass Objecttrait Matchableclass Any
Companion object for the MatchResult type. Provides utility methods for constructing and aggregating MatchResult values.
Companion object for the MatchResult type. Provides utility methods for constructing and aggregating MatchResult values.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
Trait to define the behavior of the result of a Match.
Trait to define the behavior of the result of a Match.
Type parameters
- R
-
the type of the result.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
Implicit class MatchResultOps, which allows us to use the method tee on a MatchResult[R].
Implicit class MatchResultOps, which allows us to use the method tee on a MatchResult[R].
Type parameters
- R
-
the result type of m.
Value parameters
- rr
-
a MatchResult[R].
Attributes
- Inherited from:
- Matchers
- Supertypes
-
class Objecttrait Matchableclass Any
Trait that defines the behavior of a Matcher as a function of type T => MatchResult[R] together with other filter-monadic methods, etc...
Trait that defines the behavior of a Matcher as a function of type T => MatchResult[R] together with other filter-monadic methods, etc...
Type parameters
- R
-
the result type.
- T
-
the input type.
Attributes
- Inherited from:
- Matchers
- Supertypes
- Known subtypes
-
Implicit class MatcherOps, which allows us to use the method :| on a Matcher[T,R].
Implicit class MatcherOps, which allows us to use the method :| on a Matcher[T,R].
Type parameters
- R
-
the result type of p.
- T
-
the input type of p.
Value parameters
- p
-
a Matcher[T,R].
Attributes
- Inherited from:
- Matchers
- Supertypes
-
class Objecttrait Matchableclass Any
Unsuccessful match (Miss).
Unsuccessful match (Miss).
Type parameters
- R
-
the result-type of this.
- T
-
the underlying type of t.
Value parameters
- t
-
the value that was not matched.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Implicit class ParserOps, which allows us to use the method m on a String.
Implicit class ParserOps, which allows us to use the method m on a String.
Value parameters
- s
-
a String.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
class Objecttrait Matchableclass Any
Extractor object for matching unsuccessful MatchResult values.
Extractor object for matching unsuccessful MatchResult values.
The Unsuccessful object serves as a pattern to extract information from instances of MatchResult that represent an unsuccessful match. It matches error cases and provides access to the underlying details (either an exception or a message) wrapped in a Left or Right.
Attributes
- Inherited from:
- Matchers
- Supertypes
-
trait Sumtrait Mirrorclass Objecttrait Matchableclass Any
Inherited and Abstract classlikes
Unsuccessful match of type dependent on X.
Unsuccessful match of type dependent on X.
TODO eliminate X (or R?) from the type signature.
Type parameters
- R
-
the result-type of this.
- X
-
the type of x.
Value parameters
- x
-
either a String or a Throwable.
Attributes
- Inherited from:
- Matchers
- Supertypes
- Known subtypes
Inherited types
Represents a type alias AutoMatcher[T] which defines a Matcher[T, T] that matches an input value of type T to a MatchResult of the same type T.
Represents a type alias AutoMatcher[T] which defines a Matcher[T, T] that matches an input value of type T to a MatchResult of the same type T.
This type alias can be used to simplify and make the code more readable where such a transformation operation is utilized.
T is the type of both the input and MatchResult values.
Attributes
- Inherited from:
- Matchers
Value members
Concrete methods
Method to create an ExpressionMatcher.
Method to create an ExpressionMatcher.
Type parameters
- R
-
the MatchResult type.
Value parameters
- f
-
a function Expression => MatchResult[R]
Attributes
- Returns
-
a Matcher[Expression, R] which is also an ExpressionMatcher[R].
Determines whether the provided pair of ExpressionMonoFunction values are complementary monadic functions such as exponential and logarithmic.
Determines whether the provided pair of ExpressionMonoFunction values are complementary monadic functions such as exponential and logarithmic.
TODO move this into ExpressionMonoFunction.
Value parameters
- f
-
The first
ExpressionMonoFunctionvalue to compare. - g
-
The second
ExpressionMonoFunctionvalue to compare.
Attributes
- Returns
-
True if the functions are complementary, otherwise false.
Matches and simplifies an Aggregate expression by identifying and eliminating complementary terms among its components. Specifically, it sorts the components of the aggregate expression, determines complementary elements based on a provided function, and reduces the expression if a match is found.
Matches and simplifies an Aggregate expression by identifying and eliminating complementary terms among its components. Specifically, it sorts the components of the aggregate expression, determines complementary elements based on a provided function, and reduces the expression if a match is found.
The method assumes that the provided aggregate function f typically involves operations where complementary terms can be identified (e.g., summation).
TODO refactor and move what we can into Aggregate.
Attributes
- Returns
-
A
Matcher[Aggregate, Expression]that either matches an aggregate expression with reduced complementary terms or returns a miss description if no reduction takes place.
A matcher function that processes instances of BiFunction and evaluates whether its terms are complementary based on a provided condition. If the terms are complementary, it attempts to eliminate them by returning their identity literal. Otherwise, it provides information about why the matching failed.
A matcher function that processes instances of BiFunction and evaluates whether its terms are complementary based on a provided condition. If the terms are complementary, it attempts to eliminate them by returning their identity literal. Otherwise, it provides information about why the matching failed.
Attributes
- Returns
-
A
Matcher[BiFunction, Expression]where: - If the terms of theBiFunctionare complementary and have an identity, it returns aMatchcontaining the identity as aLiteral. - If the terms are complementary but lack an identity, it returns aMisswith a corresponding message and the originalBiFunction. - If the terms are not complementary, it returns aMisswith a message indicating this and the input term.
Determines whether the factors of the given expressions match according to the specified binary function. NOTE there's another factorsMatch method in Expression NOTE this method appears to be used only by ExpressionMatchersSpec
Determines whether the factors of the given expressions match according to the specified binary function. NOTE there's another factorsMatch method in Expression NOTE this method appears to be used only by ExpressionMatchersSpec
Value parameters
- f
-
The binary function that determines the operation type (e.g., Sum, Product, Power).
- x
-
The first expression to compare.
- y
-
The second expression to compare.
Attributes
- Returns
-
True if the factors match according to the binary function, false otherwise.
Determines if the given bi-function is complementary for the specified expressions.
Determines if the given bi-function is complementary for the specified expressions.
Value parameters
- f
-
the bi-function to evaluate
- x
-
the first expression to be checked
- y
-
the second expression to be checked
Attributes
- Returns
-
true if the bi-function is complementary for the given expressions, false otherwise
Matches and combines atomic literal expressions within an Aggregate structure. If atomic literals are present and can be evaluated, they are combined and the result is returned. The remaining non-literal expressions, if any, are preserved.
Matches and combines atomic literal expressions within an Aggregate structure. If atomic literals are present and can be evaluated, they are combined and the result is returned. The remaining non-literal expressions, if any, are preserved.
Attributes
- Returns
-
A matcher that processes an
Aggregateinstance. ReturnsMatchif literals are successfully combined, orMissif no literals are found or they cannot be combined.
Matches and transforms nested BiFunction structures into an Aggregate if they meet specific conditions where the nested functions share the same operation. Specifically:
Matches and transforms nested BiFunction structures into an Aggregate if they meet specific conditions where the nested functions share the same operation. Specifically:
- When nested
BiFunctionobjects share the same binary function at all levels, they are aggregated into a singleAggregateexpression with all the operands. - If no valid aggregation pattern is matched, the original expression is returned unchanged.
Attributes
- Returns
-
A
Matcher[BiFunction, Aggregate]that attempts to match a BiFunction and transform it into an Aggregate if conditions are satisfied. If the input does not meet the required conditions, it returns a Miss.
Matches complementary mathematical expressions based on specified patterns. The method leverages rules for operations such as summation and multiplication and identifies complementary pairs (e.g., a number and its negation or reciprocal). The resulting expression is derived from the matched rule or an indication of no match.
Matches complementary mathematical expressions based on specified patterns. The method leverages rules for operations such as summation and multiplication and identifies complementary pairs (e.g., a number and its negation or reciprocal). The resulting expression is derived from the matched rule or an indication of no match.
Attributes
- Returns
-
A
Matcherthat attempts to match the providedDyadicTripleto a simplifiedExpression, or returns information about a failure to match.
Matcher which matches on Expressions that directly represents a specific given Field.
Matcher which matches on Expressions that directly represents a specific given Field.
Value parameters
- x
-
the Number to match.
Attributes
- Returns
-
a Matcher[Expression, Number].
Simplifies a Aggregate expression by combining its terms in a more compact form. This method handles several cases:
Simplifies a Aggregate expression by combining its terms in a more compact form. This method handles several cases:
- If the
Aggregateis empty, it produces the appropriate identity. - If the
Aggregatecontains a single element, it simplifies that element. - If all elements in the
Aggregatecan be interpreted as numbers, it combines them iteratively and simplifies the resulting expression. - If the
Aggregatecannot be simplified further, the original structure is retained.
NOTE: Need to fix #87 NOTE: not deprecated because it's used in structuralMatcher
Attributes
- Returns
-
A
ExpressionTransformerthat matches and simplifiesAggregateexpressions efficiently. - Note
-
Throws java.util.NoSuchElementException due to invocation of get on Option (very unlikely).
Matcher which matches on Expressions that directly represent Numbers.
Matcher which matches on Expressions that directly represent Numbers.
Attributes
- Returns
-
an ExpressionMatcher[Field].
Inherited methods
Matcher that tries m on the given (~) input. If m is unsuccessful, it then tries m on the swapped (inverted) ~.
Matcher that tries m on the given (~) input. If m is unsuccessful, it then tries m on the swapped (inverted) ~.
Type parameters
- R
-
the result type.
- T
-
the input type.
Value parameters
- commutes
-
if true (the default), the order of the incoming ~ elements is immaterial, thus we can try flipping their order. If false then we do not try.
- m
-
a Matcher[T ~ T, R].
Attributes
- Returns
-
a Matcher[T ~ T, R].
- Inherited from:
- Matchers
Matcher that tries m on the given (~~) input. If m is unsuccessful, it then tries m on the rotated ~~. If that's unsuccessful, it then tries m on the inverted ~~.
Matcher that tries m on the given (~~) input. If m is unsuccessful, it then tries m on the rotated ~~. If that's unsuccessful, it then tries m on the inverted ~~.
Type parameters
- R
-
the result type.
- T
-
the input type.
Value parameters
- commutes
-
if true (the default), the order of the incoming ~ elements is immaterial, thus we can try rotating their order. If false then we do not try.
- m
-
a Matcher[T ~ T ~ T, R].
Attributes
- Returns
-
a Matcher[T ~ T ~ T, R].
- Inherited from:
- Matchers
Method to create a named Matcher, based on the given function f of form T => MatchResult[R]. Unusually, this method's identifier has a capital first letter. This is done to mimic the Parser method in the parser-combinators. It has the advantage of looking somewhat like a constructor of a Matcher.
Method to create a named Matcher, based on the given function f of form T => MatchResult[R]. Unusually, this method's identifier has a capital first letter. This is done to mimic the Parser method in the parser-combinators. It has the advantage of looking somewhat like a constructor of a Matcher.
NOTE: if you are looking for a method which takes a function f of form T => R, then you need to use the lift method.
TODO: rename Matcher as UnnamedMatcher and this as Matcher.
If f is a partial function, it may result in a MatchError. In such a case, this is simply treated as a Miss. However, if f throws some other non-fatal exception, then that will result in an Error.
Type parameters
- R
-
the result type.
- T
-
the input type.
Value parameters
- f
-
a
T => MatchResult[R]. - name
-
the name to be used when debugging this
Matcher
Attributes
- Returns
-
a
Matcher[T, R]based onf. - Inherited from:
- Matchers
Method to create a Matcher, based on the given function f of form T => MatchResult[R]. Unusually, this method's identifier has a capital first letter. This is done to mimic the Parser method in the parser-combinators. It has the advantage of looking somewhat like a constructor of a Matcher.
Method to create a Matcher, based on the given function f of form T => MatchResult[R]. Unusually, this method's identifier has a capital first letter. This is done to mimic the Parser method in the parser-combinators. It has the advantage of looking somewhat like a constructor of a Matcher.
NOTE: if you are looking for a method which takes a function f of form T => R, then you need to use the lift method.
If f is a partial function, it may result in a MatchError. In such a case, this is simply treated as a Miss. However, if f throws some other non-fatal exception, then that will result in an Error.
Type parameters
- R
-
the result type.
- T
-
the input type.
Value parameters
- f
-
a
T => MatchResult[R].
Attributes
- Returns
-
a
Matcher[T, R]based onf. - Inherited from:
- Matchers
The alt method returns a Matcher that behaves as follows: It first tries to match the input t according to the given matcher m, in which case the match is returned. If m returns a miss, then a successful match with the value of t will be returned. Therefore, this matcher always succeeds, unless there's an error.
The alt method returns a Matcher that behaves as follows: It first tries to match the input t according to the given matcher m, in which case the match is returned. If m returns a miss, then a successful match with the value of t will be returned. Therefore, this matcher always succeeds, unless there's an error.
Type parameters
- T
-
both the type of the input and the underlying type of the output.
Value parameters
- m
-
an
AutoMatcher[T]
Attributes
- Returns
-
an
AutoMatcher[T] - Inherited from:
- Matchers
Defines a Matcher which always succeeds and whose input type and result type are the same.
Defines a Matcher which always succeeds and whose input type and result type are the same.
Type parameters
- R
-
both the input type and the result type.
Attributes
- Returns
-
an
AutoMatcher[R]which always succeeds. - Inherited from:
- Matchers
Combines two AutoMatcher instances, attempting to apply the first matcher, and if it results in a match, passing the result to the second matcher. If the first matcher fails, the second matcher is applied directly to the input.
Combines two AutoMatcher instances, attempting to apply the first matcher, and if it results in a match, passing the result to the second matcher. If the first matcher fails, the second matcher is applied directly to the input.
The logic is essentially m1 & m2 | m1 | m2 but that results in over-evaluation.
Value parameters
- m1
-
The first
AutoMatcherto be applied to the input. - m2
-
The second
AutoMatcherto be applied if the first succeeds or fails.
Attributes
- Returns
-
A new
AutoMatcherthat represents the combination of the two input matchers. - Inherited from:
- Matchers
Defines a Matcher which always errs and creates an Error with the given exception.
Defines a Matcher which always errs and creates an Error with the given exception.
Type parameters
- R
-
the result type.
Value parameters
- e
-
a
Throwable.
Attributes
- Returns
-
a
Matcher[Any, R] - Inherited from:
- Matchers
Defines a Matcher which always fails and creates a Miss with the value tried.
Defines a Matcher which always fails and creates a Miss with the value tried.
Type parameters
- R
-
the result type.
- T
-
the input type.
Value parameters
- msg
-
the message to describe this failure.
Attributes
- Returns
-
a
Matcher[T, R] - Inherited from:
- Matchers
Defines a Matcher which succeeds only if the predicate p evaluates to true. The result will be named "filter."
Defines a Matcher which succeeds only if the predicate p evaluates to true. The result will be named "filter."
Type parameters
- R
-
both the input type and the result type.
Value parameters
- p
-
a predicate on type
R.
Attributes
- Returns
-
an
AutoMatcher[R]which succeeds only ifp(r)istrue. - Inherited from:
- Matchers
Method to create a Matcher of a Tilde, which succeeds if the first member matches the given Matcher.
Method to create a Matcher of a Tilde, which succeeds if the first member matches the given Matcher.
Type parameters
- R0
-
type of result's first member.
- T0
-
first of the member types.
- T1
-
second of the member types.
Attributes
- Returns
-
a Matcher[T0 ~ T1, R0 ~ T1].
- Inherited from:
- Matchers
Method to create a Matcher of ~, which succeeds if the first member matches the given Matcher.
Method to create a Matcher of ~, which succeeds if the first member matches the given Matcher.
Type parameters
- R1
-
type of result's second member.
- T0
-
first of the input member types.
- T1
-
second of the input member types.
Attributes
- Returns
-
a Matcher[T0 ~ T1, T0 ~ R1].
- Inherited from:
- Matchers
Method to create a Matcher of ~~, which succeeds if the first member matches the given Matcher.
Method to create a Matcher of ~~, which succeeds if the first member matches the given Matcher.
Type parameters
- R0
-
type of result's first member.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Attributes
- Returns
-
a Matcher[T0 ~ T1 ~ T2, R0 ~ T1 ~ T2].
- Inherited from:
- Matchers
Method to create a Matcher of ~~, which succeeds if the second member matches the given Matcher.
Method to create a Matcher of ~~, which succeeds if the second member matches the given Matcher.
Type parameters
- R1
-
type of result's second member.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Attributes
- Returns
-
a Matcher[T0 ~ T1 ~ T2, T0 ~ R1 ~ T2].
- Inherited from:
- Matchers
Method to create a Matcher of ~~, which succeeds if the third member matches the given Matcher.
Method to create a Matcher of ~~, which succeeds if the third member matches the given Matcher.
Type parameters
- R2
-
type of result's third member.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Attributes
- Returns
-
a Matcher[T0 ~ T1 ~ T2, T0 ~ T1 ~ R2].
- Inherited from:
- Matchers
Defines a Matcher which succeeds only if the predicate p evaluates to false. The result will be named "filterNot."
Defines a Matcher which succeeds only if the predicate p evaluates to false. The result will be named "filterNot."
Type parameters
- R
-
both the input type and the result type.
Value parameters
- p
-
a predicate on type
R.
Attributes
- Returns
-
an
AutoMatcher[R]which succeeds only ifp(r)isfalse. - Inherited from:
- Matchers
Method to create a Matcher which operates on a similar, but inverted, ~ as m.
Method to create a Matcher which operates on a similar, but inverted, ~ as m.
Type parameters
- R
-
the result type.
- T0
-
one of the input types.
- T1
-
the other input type.
Value parameters
- m
-
a Matcher[T0 ~ T1, R].
Attributes
- Returns
-
a Matcher[T1 ~ T0, R].
- Inherited from:
- Matchers
Method to match a T, resulting in an R, where the match is indirectly determined by the given lens function.
Method to match a T, resulting in an R, where the match is indirectly determined by the given lens function.
Type parameters
- U
-
the type of the property that is matched by m.
Value parameters
- lens
-
a function T => U.
- m
-
a Matcher[U, R].
Attributes
- Returns
-
a Matcher[T, R]
- Inherited from:
- Matchers
Method to invert the order of elements in a ~~.
Method to invert the order of elements in a ~~.
Type parameters
- T0
-
the first element type.
- T1
-
the second element type.
- T2
-
the third element type.
Attributes
- Returns
-
a Matcher[T0 ~ T1 ~ T2, T2 ~ T1 ~ T0].
- Inherited from:
- Matchers
Convenience predicate for use with create and similar methods that require a (Q, R) => Boolean argument.
Convenience predicate for use with create and similar methods that require a (Q, R) => Boolean argument.
Example:
MatchResult.create(isEqual)(expectedValue, inputValue, resultValue)
This is equivalent to _ == _ but can be passed by name where a named function reference is cleaner than a lambda.
Type parameters
- R
-
the common type.
Value parameters
- q
-
a control value.
- r
-
a result value.
Attributes
- Returns
-
true if q == r.
- Inherited from:
- Matchers
Evaluates a predicate function on a value of type R and returns a result indicating whether the predicate was satisfied.
Evaluates a predicate function on a value of type R and returns a result indicating whether the predicate was satisfied.
Value parameters
- f
-
a predicate function that takes an argument of type
Rand returns a boolean. - r
-
the value of type
Rto be evaluated by the predicate function.
Attributes
- Returns
-
a
MatchResult[R]which is aMatchif the predicate evaluates to true, or aMisscontaining a message and the evaluated value if the predicate evaluates to false. - Inherited from:
- Matchers
Method to define a Matcher based on the function f. The result will identify as "lift". Use namedLift if you want to be more specific.
Method to define a Matcher based on the function f. The result will identify as "lift". Use namedLift if you want to be more specific.
Type parameters
- R
-
the result type to both
fand the resultingMatcher. - T
-
the input type to both
fand the resultingMatcher.
Value parameters
- f
-
a function of type
T => R
Attributes
- Returns
-
a
Matcher[T, R]. - Inherited from:
- Matchers
Method to create a named Matcher, based on the given function f.
Method to create a named Matcher, based on the given function f.
CONSIDER eliminating this method.
Type parameters
- R
-
the result type.
- T
-
the input type.
Value parameters
- f
-
a
T => MatchResult[R]. - name
-
the name for the logger to mention.
Attributes
- Returns
-
a
Matcher[T, R]based onf. - Inherited from:
- Matchers
Method to match all elements of a ~.
Method to match all elements of a ~.
Type parameters
- R0
-
the MatchResult type for m0.
- R1
-
the MatchResult type for m1.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
Value parameters
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
Attributes
- Returns
-
a Matcher[T0 ~ T1, R0 ~ R1] that matches all the elements of the given ~.
- Inherited from:
- Matchers
Method to match any element of a ~.
Method to match any element of a ~.
Type parameters
- R
-
the MatchResult type.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
Value parameters
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
Attributes
- Returns
-
a Matcher[T0 ~ T1, R] that matches at least one of the elements of the given tilde.
- Inherited from:
- Matchers
Method to match all elements of a ~~.
Method to match all elements of a ~~.
Type parameters
- R0
-
the MatchResult type for m0.
- R1
-
the MatchResult type for m1.
- R2
-
the MatchResult type for m2.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
Value parameters
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
Attributes
- Returns
-
a Matcher[T0 ~ T1 ~ T2, R0 ~ R1 ~ R2] that matches at least one of the elements of the given ~~.
- Inherited from:
- Matchers
Method to match any element of a Tuple3.
Method to match any element of a Tuple3.
TODO fix me
Type parameters
- R
-
the MatchResult type.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
- T2
-
the input type for the third Matcher.
Value parameters
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
- m2
-
the Matcher corresponding to the third element.
Attributes
- Returns
-
a Matcher[(T0, T1, T2), R] that matches at least one of the elements of the given tuple.
- Inherited from:
- Matchers
Creates a matcher that checks if all elements in a sequence satisfy the given matcher.
Creates a matcher that checks if all elements in a sequence satisfy the given matcher.
Value parameters
- m
-
A matcher of type
AutoMatcher[T].
Attributes
- Returns
-
A new matcher that validates sequences of type
Seq[T]. The matcher succeeds if all elements in the sequence satisfy the given matcherm, otherwise it returns a miss with the name "matchAll" and the unmatched sequence. - Inherited from:
- Matchers
Creates a matcher that checks if any element in a sequence satisfies the given matcher.
Creates a matcher that checks if any element in a sequence satisfies the given matcher.
Value parameters
- m
-
A matcher of type
AutoMatcher[T].
Attributes
- Returns
-
a new matcher that takes a sequence of type
Tand returns a sequence of typeT. indicating whether at least one element in the sequence satisfies the given matcherm. - Inherited from:
- Matchers
Matches the input wrapped in an Option and returns a corresponding MatchResult.
Matches the input wrapped in an Option and returns a corresponding MatchResult.
Value parameters
- ry
-
an optional value of type R to be matched
- t
-
the value of type T used when the optional value is not defined
Attributes
- Returns
-
a MatchResult of type R. Returns a Match wrapping the value when the optional is defined, otherwise returns a Miss with a message and the provided value t.
- Inherited from:
- Matchers
Matches the result of a Try operation and produces a MatchResult.
Matches the result of a Try operation and produces a MatchResult.
Value parameters
- ry
-
the Try instance representing a successful or failed computation
- t
-
the input value to be used in case of a failure
Attributes
- Returns
-
a MatchResult containing the success value if the Try is successful, or a failure message along with the input value if the Try is a failure
- Inherited from:
- Matchers
Creates a MatchResult[R] from applying a given T => Option[R] function to a value of T. NOTE this replaces the previous (1.0.12) version which had only one parametric type (T). It will be backwards-compatible but providing the types are not explicitly specified.
Creates a MatchResult[R] from applying a given T => Option[R] function to a value of T. NOTE this replaces the previous (1.0.12) version which had only one parametric type (T). It will be backwards-compatible but providing the types are not explicitly specified.
Value parameters
- f
-
A function that takes an input of type
Tand returns anOption[R]. - t
-
The input of type
Tto which the functionfis applied.
Attributes
- Returns
-
A
MatchResult[R]based on the result of applying the functionfto the inputt. - Inherited from:
- Matchers
Creates a MatchResult by applying a given function f to an input value of type T, and matching the result if the function yields a defined Option. Matches and processes a given input using a function that returns an Option. TODO promote this into Matchers (where matchOptionFunc is already defined but could be based on this method).
Creates a MatchResult by applying a given function f to an input value of type T, and matching the result if the function yields a defined Option. Matches and processes a given input using a function that returns an Option. TODO promote this into Matchers (where matchOptionFunc is already defined but could be based on this method).
Type parameters
- R
-
the result type contained in the
Option. - T
-
the input type.
Value parameters
- f
-
a function that transforms an input of type
Tinto anOption[R]. - t
-
the input value of type
Tto be transformed and matched.
Attributes
- Returns
-
a
MatchResult[R]constructed from the result of the function if theOptionis defined. - Inherited from:
- MatchersExtras
Method to match any element of a Product with two elements.
Method to match any element of a Product with two elements.
Type parameters
- P
-
the input type.
- R0
-
the first MatchResult type.
- R1
-
the second MatchResult type.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
Value parameters
- f
-
a function that takes a (t0, t1) and returns a P.
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
Attributes
- Returns
-
a Matcher[P, R0 ~ R1] that matches at least one of the elements of the given P.
- Inherited from:
- Matchers
Method to match any element of a Product with two elements.
Method to match any element of a Product with two elements.
Type parameters
- P
-
the input type.
- R
-
the MatchResult type.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
Value parameters
- f
-
a function that takes a (t0, t1) and returns a P.
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
Attributes
- Returns
-
a Matcher[P, R] that matches at least one of the elements of the given P.
- Inherited from:
- Matchers
Method to match any element of a Product with two elements.
Method to match any element of a Product with two elements.
Type parameters
- P
-
the input type.
- R0
-
the first MatchResult type.
- R1
-
the second MatchResult type.
- R2
-
the third MatchResult type.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
- T2
-
the input type for the third Matcher.
Value parameters
- f
-
a function that takes a (t0, t1, t3) and returns a P.
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
- m2
-
the Matcher corresponding to the third element.
Attributes
- Returns
-
a Matcher[P, R0 ~ R1 ~ R2] that matches at least one of the elements of the given P.
- Inherited from:
- Matchers
Method to match any element of a Product with two elements.
Method to match any element of a Product with two elements.
Type parameters
- P
-
the input type.
- R
-
the MatchResult type.
- T0
-
the input type for the first Matcher.
- T1
-
the input type for the second Matcher.
- T2
-
the input type for the third Matcher.
Value parameters
- f
-
a function that takes a (t0, t1, t3) and returns a P.
- m0
-
the Matcher corresponding to the first element.
- m1
-
the Matcher corresponding to the second element.
- m2
-
the Matcher corresponding to the third element.
Attributes
- Returns
-
a Matcher[P, R] that matches at least one of the elements of the given P.
- Inherited from:
- Matchers
Method to create a Matcher, of three MatchResults whose result is a P.
Method to create a Matcher, of three MatchResults whose result is a P.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Value parameters
- f
-
method to convert a (T0, T1, T2) into a P.
Attributes
- Returns
-
r0 a MatchResult[T0].
- Inherited from:
- Matchers
Method to convert a MatchResult[~~] to a MatchResult[P].
Method to convert a MatchResult[~~] to a MatchResult[P].
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Value parameters
- f
-
method to convert a (T0, T1, T2) into a P.
Attributes
- Returns
-
t a MatchResult[T0 ~ T1 ~ T2].
- Inherited from:
- Matchers
Creates a MatchResult[R] from applying a given T => Try[R] function to a value of T. NOTE this replaces the previous (1.0.12) version which had only one parametric type (T). It will be backwards-compatible but providing the types are not explicitly specified.
Creates a MatchResult[R] from applying a given T => Try[R] function to a value of T. NOTE this replaces the previous (1.0.12) version which had only one parametric type (T). It will be backwards-compatible but providing the types are not explicitly specified.
Value parameters
- f
-
A function that takes an input of type
Tand returns aTryof typeR. - t
-
The input value of type
Tto be processed by the functionf.
Attributes
- Returns
-
A
MatchResultof typeR, which represents the result of matching the successful outcome off(t). - Inherited from:
- Matchers
Defines a Matcher which succeeds if the input is equal to the given r. The result will be named "matches."
Defines a Matcher which succeeds if the input is equal to the given r. The result will be named "matches."
Type parameters
- R
-
both the input type and the result type.
Value parameters
- r
-
the value that must be matched.
Attributes
- Returns
-
an
AutoMatcher[R]. - Inherited from:
- Matchers
Defines a Matcher which succeeds only if b is true (regardless of the input to the Matcher). The result will be named "maybe."
Defines a Matcher which succeeds only if b is true (regardless of the input to the Matcher). The result will be named "maybe."
Type parameters
- R
-
both the input type and the result type.
Value parameters
- b
-
a
Booleanvalue that determines whether the result succeeds.
Attributes
- Returns
-
an
AutoMatcher[R]which succeeds ifbis true. - Inherited from:
- Matchers
Method to define a named Matcher based on the function f.
Method to define a named Matcher based on the function f.
Type parameters
- R
-
the result type to both
fand the resultingMatcher. - T
-
the input type to both
fand the resultingMatcher.
Value parameters
- f
-
a function of type
T => R - name
-
the name by which the resulting
Matcherwill be identified.
Attributes
- Returns
-
a
Matcher[T, R]. - Inherited from:
- Matchers
Defines a Matcher which reverses the sense of this Matcher. However, an Error remains an Error. The result is named "not." TODO define this in terms of MatchResult.invert
Defines a Matcher which reverses the sense of this Matcher. However, an Error remains an Error. The result is named "not." TODO define this in terms of MatchResult.invert
Type parameters
- R
-
the result type of m.
- T
-
the input type of m.
Value parameters
- m
-
a
Matcher[T, R] - r
-
the default result value, only to be used in the even of a
Miss.
Attributes
- Returns
-
a
Matcher[T, R]which works in the opposite sense to this. - Inherited from:
- Matchers
Matcher that always succeeds but whose result is an Option[R]. The result is named "opt." If the bound variable t of the resulting Matcher is null, then it will result in a Match(None).
Matcher that always succeeds but whose result is an Option[R]. The result is named "opt." If the bound variable t of the resulting Matcher is null, then it will result in a Match(None).
Type parameters
- R
-
the result type of m.
- T
-
the input type of m.
Value parameters
- m
-
a Matcher[T, R]
Attributes
- Returns
-
Matcher[T, Option of R]
- Inherited from:
- Matchers
Method to yield a parser af R from a String interpreted as a regular expression.
Method to yield a parser af R from a String interpreted as a regular expression.
Type parameters
- R
-
the underlying type of resulting Parser.
Value parameters
- p
-
a Parser[R].
- regex
-
the String representation of the regular expression.
Attributes
- Returns
-
a Parser[R]
- Inherited from:
- Matchers
Method to yield a parser af R from a regular expression.
Method to yield a parser af R from a regular expression.
Type parameters
- R
-
the underlying type of resulting Parser.
Value parameters
- p
-
a Parser[R].
- regex
-
a Regex.
Attributes
- Returns
-
a Parser[R]
- Inherited from:
- Matchers
Method to yield a parser af String from a regular expression.
Method to yield a parser af String from a regular expression.
Value parameters
- regex
-
the String representation of the regular expression.
Attributes
- Returns
-
a Parser[String]
- Inherited from:
- Matchers
Method to yield a parser af String from a regular expression.
Method to yield a parser af String from a regular expression.
Value parameters
- regex
-
a Regex.
Attributes
- Returns
-
a Parser[String]
- Inherited from:
- Matchers
Method to yield a Parser[Z] using the given regex, a function String=>P0 and a function P0=>Z. Typically, Z will be a case class.
Method to yield a Parser[Z] using the given regex, a function String=>P0 and a function P0=>Z. Typically, Z will be a case class.
TESTME
Type parameters
- P0
-
the type of the first member of Z.
- Z
-
the underlying type of the resulting parser.
Value parameters
- construct
-
a function P0 => Z.
- groups
-
a list of required group indexes, starting at 1 (if empty, then all groups are selected).
- p0
-
a Parser[P0].
- regex
-
a regular expression.
Attributes
- Returns
-
a Parser[Z].
- Inherited from:
- Matchers
Method to yield a Parser[Z] using the given regex, several intermediate functions, and a function (P0, P1)=>Z. Typically, Z will be a case class with two members.
Method to yield a Parser[Z] using the given regex, several intermediate functions, and a function (P0, P1)=>Z. Typically, Z will be a case class with two members.
Type parameters
- P0
-
the type of the first member of Z.
- P1
-
the type of the second member of Z.
- Z
-
the underlying type of the resulting parser.
Value parameters
- construct
-
a function (P0, P1) => Z.
- groups
-
a list of required group indexes, starting at 1 (if empty, then all groups are selected).
- p0
-
a Parser[P0].
- p1
-
a Parser[P1].
- regex
-
a regular expression.
Attributes
- Returns
-
a Parser[Z].
- Inherited from:
- Matchers
Method to yield a Parser[Z] using the given regex, several intermediate functions, and a function (P0, P1, P2)=>Z. Typically, Z will be a case class with three members.
Method to yield a Parser[Z] using the given regex, several intermediate functions, and a function (P0, P1, P2)=>Z. Typically, Z will be a case class with three members.
Type parameters
- P0
-
the type of the first member of Z.
- P1
-
the type of the second member of Z.
- P2
-
the type of the third member of Z.
- Z
-
the underlying type of the resulting parser.
Value parameters
- construct
-
a function (P0, P1, P2) => Z.
- groups
-
a list of required group indexes, starting at 1 (if empty, then all groups are selected).
- p0
-
a Parser[P0].
- p1
-
a Parser[P1].
- p2
-
a Parser[P2].
- regex
-
a regular expression.
Attributes
- Returns
-
a Parser[Z].
- Inherited from:
- Matchers
Method to yield a parser af R from a regular expression and groups. There must be only one matching group.
Method to yield a parser af R from a regular expression and groups. There must be only one matching group.
Type parameters
- R
-
the underlying type of resulting Parser.
Value parameters
- group
-
an optional group index, starting at 1 (if empty, then all groups are selected).
- p
-
a Parser[R].
- regex
-
the String representation of the regular expression.
Attributes
- Returns
-
a Parser[R]
- Inherited from:
- Matchers
Method to yield a parser af R from a regular expression and groups. There must be only one matching group.
Method to yield a parser af R from a regular expression and groups. There must be only one matching group.
Type parameters
- R
-
the underlying type of resulting Parser.
Value parameters
- group
-
an optional group index, starting at 1 (if empty, then all groups are selected).
- p
-
a Parser[R].
- regex
-
a Regex.
Attributes
- Returns
-
a Parser[R]
- Inherited from:
- Matchers
Method to yield a parser af R from a regular expression and groups. There must be only one matching group.
Method to yield a parser af R from a regular expression and groups. There must be only one matching group.
Type parameters
- R
-
the underlying type of the resulting
Parser.
Value parameters
- p
-
a
Parser[R]. - regexGroups
-
an instance of RegexGroups.
Attributes
- Returns
-
a
Parser[R] - Inherited from:
- Matchers
Parser that succeeds if the input matches the given regular expression. The result of the parser is the desired List of matched Strings.
Parser that succeeds if the input matches the given regular expression. The result of the parser is the desired List of matched Strings.
Value parameters
- groups
-
a list of required group indexes, starting at 1 (if empty, then all groups are selected).
- regex
-
a regular expression as a String.
Attributes
- Returns
-
a Parser[List of Strings].
- Inherited from:
- Matchers
Parser that succeeds if the input matches the given regular expression. The result of the parser is the desired List of matched Strings.
Parser that succeeds if the input matches the given regular expression. The result of the parser is the desired List of matched Strings.
Value parameters
- groups
-
a list of required group indexes, starting at 1 (if empty, then all groups are selected).
- regex
-
a regular expression.
Attributes
- Returns
-
a Parser[List of Strings].
- Inherited from:
- Matchers
Parser that succeeds if the input matches the given regular expression. The result of the parser is the desired List of matched Strings.
Parser that succeeds if the input matches the given regular expression. The result of the parser is the desired List of matched Strings.
Value parameters
- rg
-
an instance of RegexGroups.
Attributes
- Returns
-
a Parser[List of Strings].
- Inherited from:
- Matchers
Method to parse two Strings from a regular expression.
Method to parse two Strings from a regular expression.
Value parameters
- groups
-
a list of required group indexes, starting at 1 (if empty, then all groups are selected).
- regex
-
the String representation of the regular expression.
Attributes
- Returns
-
a Parser[String ~ String]
- Inherited from:
- Matchers
Method to parse two Strings from a regular expression.
Method to parse two Strings from a regular expression.
Value parameters
- groups
-
a list of required group indexes, starting at 1 (if empty, then all groups are selected).
- regex
-
a Regex.
Attributes
- Returns
-
a Parser[String ~ String]
- Inherited from:
- Matchers
Method to parse two Strings from a regular expression.
Method to parse two Strings from a regular expression.
Value parameters
- regexGroups
-
an instance of RegexGroups.
Attributes
- Returns
-
a Parser[String ~ String]
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a ~ whose result is a P. This method is the inverse of tilde2.
Method to create a Matcher, which always succeeds, of a ~ whose result is a P. This method is the inverse of tilde2.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
Value parameters
- f
-
method to convert a (T0, T1) into a P.
Attributes
- Returns
-
a Matcher[T0 ~ T1, P].
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a ~~ whose result is a P. This method is the inverse of tilde2.
Method to create a Matcher, which always succeeds, of a ~~ whose result is a P. This method is the inverse of tilde2.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
Value parameters
- f
-
method to convert a (T0, T1) into a P.
Attributes
- Returns
-
a Matcher[T0 ~ T1 ~ T2, P].
- Inherited from:
- Matchers
Method to rotate the order of elements in a ~~.
Method to rotate the order of elements in a ~~.
Type parameters
- T0
-
the first element type.
- T1
-
the second element type.
- T2
-
the third element type.
Attributes
- Returns
-
a Matcher[T0 ~ T1 ~ T2, T1 ~ T2 ~ T0].
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a P whose result is a T0, based on the first element of P.
Method to create a Matcher, which always succeeds, of a P whose result is a T0, based on the first element of P.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
Value parameters
- f
-
method to convert a (T0, T1) into a P (used at compile-time only).
Attributes
- Returns
-
a Matcher[P,T0]
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a P whose result is a T1, based on the second element of P.
Method to create a Matcher, which always succeeds, of a P whose result is a T1, based on the second element of P.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
Value parameters
- f
-
method to convert a (T0, T1) into a P (used at compile-time only).
Attributes
- Returns
-
a Matcher[P,T1]
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a P whose result is a T0, based on the first element of P.
Method to create a Matcher, which always succeeds, of a P whose result is a T0, based on the first element of P.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Value parameters
- f
-
method to convert a (T0, T1, T2) into a P (used at compile-time only).
Attributes
- Returns
-
a Matcher[P,T0]
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a P whose result is a T1, based on the second element of P.
Method to create a Matcher, which always succeeds, of a P whose result is a T1, based on the second element of P.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Value parameters
- f
-
method to convert a (T0, T1, T2) into a P (used at compile-time only).
Attributes
- Returns
-
a Matcher[P,T1]
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a P whose result is a T2, based on the third element of P.
Method to create a Matcher, which always succeeds, of a P whose result is a T2, based on the third element of P.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Value parameters
- f
-
method to convert a (T0, T1, T2) into a P (used at compile-time only).
Attributes
- Returns
-
a Matcher[P,T1]
- Inherited from:
- Matchers
Method to convert an Option of MatchResult[R] into a MatchResult of Option[R].
Method to convert an Option of MatchResult[R] into a MatchResult of Option[R].
Type parameters
- R
-
the underlying result type.
Value parameters
- rmo
-
an optional MatchResult[R].
Attributes
- Returns
-
a MatchResult of Option[R].
- Inherited from:
- Matchers
Transforms (lifts) a matcher for individual elements into a matcher for sequences of those elements.
Transforms (lifts) a matcher for individual elements into a matcher for sequences of those elements.
This method applies the provided matcher to each element of the input sequence and aggregates the results.
Value parameters
- m
-
the matcher to apply to each element of the sequence
Attributes
- Returns
-
a matcher that processes a sequence of elements and matches them based on the provided matcher
- Inherited from:
- Matchers
Transforms (lifts) a matcher for individual elements into a matcher for sequences of those elements. The returned Matcher ensures that all elements in the input sequence are matched using the provided Matcher.
Transforms (lifts) a matcher for individual elements into a matcher for sequences of those elements. The returned Matcher ensures that all elements in the input sequence are matched using the provided Matcher.
Value parameters
- m
-
The
Matcherto apply to each element of the sequence.
Attributes
- Returns
-
A
Matcherthat matches a sequence of elements using the providedMatcher. - See also
-
MatchResult#sequenceStrict
- Inherited from:
- Matchers
Defines a Matcher which always succeeds and creates a Match with value r.
Defines a Matcher which always succeeds and creates a Match with value r.
NOTE: be careful not to force evaluation of r outside MatchResult.
Type parameters
- R
-
the result type.
- T
-
the input type (input is ignored).
Value parameters
- r
-
the predetermined result (call-by-name).
Attributes
- Returns
-
a
Matcher[T, R] - Inherited from:
- Matchers
Method to swap the order of elements in a Tilde.
Method to swap the order of elements in a Tilde.
Type parameters
- T0
-
the first element type.
- T1
-
the second element type.
Attributes
- Returns
-
a Matcher from T0 ~ T1 to T1 ~ T0.
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a P whose result is a ~.
Method to create a Matcher, which always succeeds, of a P whose result is a ~.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
Value parameters
- f
-
method to convert a (T0, T1) into a P.
Attributes
- Returns
-
a Matcher[P, T0 ~ T1].
- Inherited from:
- Matchers
Method to create a Matcher, which always succeeds, of a P whose result is a ~~.
Method to create a Matcher, which always succeeds, of a P whose result is a ~~.
Type parameters
- P
-
the product type.
- T0
-
first of the member types.
- T1
-
second of the member types.
- T2
-
third of the member types.
Value parameters
- f
-
method to convert a (T0, T1, T2) into a P.
Attributes
- Returns
-
a Matcher[P, T0 ~ T1 ~ T2].
- Inherited from:
- Matchers
Method to convert a MatchResult of Option[R] into a MatchResult[R]. NOTE this was formerly called sequence.
Method to convert a MatchResult of Option[R] into a MatchResult[R]. NOTE this was formerly called sequence.
Type parameters
- R
-
the underlying result type.
Value parameters
- rom
-
a MatchResult of Option[R].
Attributes
- Returns
-
a Match[R] if rom is a Match(Some(r)) otherwise a Miss.
- Inherited from:
- Matchers
Matcher whose success depends on the application of a function f to the input, then the application of a predicate to a control value and the result of f.
Matcher whose success depends on the application of a function f to the input, then the application of a predicate to a control value and the result of f.
CONSIDER what to do with this
Type parameters
- Q
-
the "control" type.
- T
-
the "input" type.
Value parameters
- p
-
a predicate based on the tuple (q, r) where r is the result of applying f to t.
Attributes
- Returns
-
a
Matcher[(Q, R), T]. - Inherited from:
- Matchers
Matcher whose success depends on the application of a function f to the input, then the application of a predicate to a control value and the result of f.
Matcher whose success depends on the application of a function f to the input, then the application of a predicate to a control value and the result of f.
CONSIDER what to do with this
Type parameters
- Q
-
the "control" type.
- R
-
the result type.
- T
-
the "input" type.
Value parameters
- f
-
a T => R.
- p
-
a predicate based on the tuple (q, r) where r is the result of applying f to t.
Attributes
- Returns
-
a
Matcher[(Q, R), T]. - Inherited from:
- Matchers
Inherited fields
A parser that matches a decimal number. The parser matches numbers with optional leading digits, a decimal point, and optional trailing digits.
A parser that matches a decimal number. The parser matches numbers with optional leading digits, a decimal point, and optional trailing digits.
Examples of matched patterns include:
- Whole numbers: "123"
- Floating-point numbers with leading digits: "123.456"
- Floating-point numbers without leading digits: ".456"
- Floating-point numbers with trailing decimal point: "123."
Attributes
- Inherited from:
- Matchers
A parser for matching floating-point numbers in string format. This parser identifies numbers with optional signs, decimal points, optional scientific notation (e/E with an optional sign), and optional floating-point type suffixes (f/F/d/D).
A parser for matching floating-point numbers in string format. This parser identifies numbers with optional signs, decimal points, optional scientific notation (e/E with an optional sign), and optional floating-point type suffixes (f/F/d/D).
The recognized pattern includes:
- Optional leading negative sign (-).
- Digits before and/or after a decimal point.
- Scientific notation with an optional positive or negative sign.
- Optional floating-point suffix (f, F, d, D).
The parsing is performed using a provided regular expression pattern.
Attributes
- Inherited from:
- Matchers
Attributes
- Returns
-
a Parser[BigDecimal]
- Inherited from:
- Matchers
Attributes
- Returns
-
a Parser[BigInt]
- Inherited from:
- Matchers
Attributes
- Returns
-
a Parser[Double]
- Inherited from:
- Matchers
Attributes
- Returns
-
a Parser[Int]
- Inherited from:
- Matchers
Attributes
- Returns
-
a Parser[Long]
- Inherited from:
- Matchers
Givens
Givens
A protected value that represents a logger dedicated to capturing and managing log entries related to match operations.
A protected value that represents a logger dedicated to capturing and managing log entries related to match operations.
Attributes
Implicits
Implicits
Implicit method to convert a Matcher[Expression, R] into an ExpressionMatcher[R].
Implicit method to convert a Matcher[Expression, R] into an ExpressionMatcher[R].
CONSIDER if we used a type alias for ExpressionMatcher, would we still need this?
Type parameters
- R
-
the result type.
Value parameters
- m
-
a Matcher[Expression, R].
Attributes
- Returns
-
ExpressionMatcher[R]
Inherited implicits
Implicit class MatchResultOps, which allows us to use the method tee on a MatchResult[R].
Implicit class MatchResultOps, which allows us to use the method tee on a MatchResult[R].
Type parameters
- R
-
the result type of m.
Value parameters
- rr
-
a MatchResult[R].
Attributes
- Inherited from:
- Matchers
Implicit class MatcherOps, which allows us to use the method :| on a Matcher[T,R].
Implicit class MatcherOps, which allows us to use the method :| on a Matcher[T,R].
Type parameters
- R
-
the result type of p.
- T
-
the input type of p.
Value parameters
- p
-
a Matcher[T,R].
Attributes
- Inherited from:
- Matchers