Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Predefined Match values for common cases. True = BoolMatch(true) False = BoolMatch(false) )
Functions ¶
This section is empty.
Types ¶
type BoolMatch ¶ added in v0.3.0
type BoolMatch bool
BoolMatch is a simple Match implementation based on a boolean value.
type Match ¶ added in v0.3.0
type Match interface {
OK() bool
}
Match represents the result of a predicate evaluation.
type PR ¶ added in v0.3.0
PR is a predicate function that tests whether a value of type T satisfies some condition and returns a Match result.
func (PR[T]) And ¶ added in v0.3.0
And returns a predicate that is a short-circuiting logical AND of this and the given predicates.
func (PR[T]) Filter ¶ added in v0.3.0
func (p PR[T]) Filter(s []T) []T
Filter returns a new slice holding only the elements of s that satisfy p. Filter modifies the contents of the slice s and returns the modified slice, which may have a smaller length.
func (PR[T]) FilterCopy ¶ added in v0.3.0
func (p PR[T]) FilterCopy(s []T) []T
FilterCopy returns a new slice holding only the elements of s that satisfy p.
Click to show internal directories.
Click to hide internal directories.