variant() declares a named method variant reachable only via via().
Never runs on the eager path.
Usage
variant(fn, print = NULL)
Arguments
- fn
A function with named arguments. The framework injects
data and arguments by matching formals to the processed model output.
- print
A function with signature function(x, ...) for formatting
the result. NULL falls back to print(x$data).
Value
A variant S7 object.