Create a predicate-based type specification
pred.RdValidates using a custom function with performance hints.
Usage
pred(fn, cost = c("light", "full"), timeout = NULL)Examples
# Light check - always runs
schema(data = pred(~ length(.) > 0, cost = "light"))
#> # A tibble: 0 × 1
#> # ℹ 1 variable: data <list<list>>
# Heavy check - only runs in full validation mode
schema(img = pred(~ validate_dimensions(.), cost = "full"))
#> # A tibble: 0 × 1
#> # ℹ 1 variable: img <list<list>>