nu.engine.validation.predicate
Predicate: a composable `(program, path) -> bool` test.
Module nu.engine.validation.predicate.
Predicate: a composable (program, path) -> bool test.
Testis the callable shape -- any(program, path) -> boolfunction. It is what laws ultimately consume; nothing more.Predicatewraps aTestto give it an algebra:&,|, and~combine predicates without forcing the caller to nest lambdas. The right operand of a binary combinator may be any bareTest-- the result is always aPredicate.
Wrap a plain function with the @predicate decorator to give it the same
algebra. Predicates are the building block for Law.scope and
Law.holds.
| Name | Call | Meaning |
|---|---|---|
| predicate | lang.predicate(test) | Wrap a (program, path) -> bool function as a composable Predicate. |
predicate
Wrap a (program, path) -> bool function as a composable Predicate.
lang.predicate(test)Path nu.lang.predicate. Defined on nu.engine.validation.predicate, bound as a function. Builds Predicate.
Arguments
| Name | Type | Default | Meaning |
|---|---|---|---|
test | Test |
Undocumented: example.