- Companion:
- class
Type members
Classlikes
Combines two SingleElementContextMatcher
s such that the resulting matcher will succeed if both the
right
and left
matchers succeed, and returns the results of both matchers (as a tuple, but reduced
via the TypeReduce
rules)
Combines two SingleElementContextMatcher
s such that the resulting matcher will succeed if both the
right
and left
matchers succeed, and returns the results of both matchers (as a tuple, but reduced
via the TypeReduce
rules)
- Type parameters:
- A
The left matcher's context type
- B
The right matcher's context type
- R
The type reduction of
(A, B)
- Value parameters:
- left
The left matcher, with a context type of
A
- reduce
The
TypeReduce
rule- right
The right matcher, with a context type of
B
SingleElementContextMatcher that delegates to the given function f
to perform its match.
SingleElementContextMatcher that delegates to the given function f
to perform its match.
- Type parameters:
- A
The matched context type
- Value parameters:
- f
A function that performs the context match on a single element
Similar to ContextMatcher.Mapped
, but specialized for SingleElementContextMatcher
Similar to ContextMatcher.Mapped
, but specialized for SingleElementContextMatcher
Similar to ContextMatcher.Or
, but specialized for SingleElementContextMatcher
Similar to ContextMatcher.Or
, but specialized for SingleElementContextMatcher
SingleElementContextMatcher that successfully matches (with no result) if the
given predicate function returns true
for the matched element.
SingleElementContextMatcher that successfully matches (with no result) if the
given predicate function returns true
for the matched element.
- Value parameters:
- f
The predicate function
Value members
Concrete methods
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack. If f
returns None
, the match fails, otherwise, the match succeeds.
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack. If f
returns None
, the match fails, otherwise, the match succeeds.
- Type parameters:
- A
The match result type
- Value parameters:
- f
The matcher function
- Returns:
A new single-element matcher which applies
f
to the stack head
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack. If f
returns None
, the match fails, otherwise, the match succeeds.
Create a new single-element matcher which calls the given matcher function f
on the first
element of the stack. If f
returns None
, the match fails, otherwise, the match succeeds.
- Type parameters:
- A
The match result type
- Value parameters:
- f
The matcher function
- name
This value will be used as the matcher's
toString
- Returns:
A new single-element matcher which applies
f
to the stack head
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack. If f
returns true
, the match succeeds. Otherwise, the match fails.
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack. If f
returns true
, the match succeeds. Otherwise, the match fails.
- Value parameters:
- f
The predicate function
- Returns:
A new single-element matcher which uses
f
to determine a match
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack. If f
returns true
, the match succeeds. Otherwise, the match fails.
Create a new single-element matcher which calls the given predicate function f
on the first
element of the stack. If f
returns true
, the match succeeds. Otherwise, the match fails.
- Value parameters:
- f
The predicate function
- name
This value will be used as the matcher's
toString
- Returns:
A new single-element matcher which uses
f
to determine a match