Pipe a possibly unresolved value forward into a function.
x %>>% f
a value that is possibly an 'unresolvedValue'.
a function that accepts 'x' as its first argument.
The evaluated result, or if x is an 'unresolvedValue', an 'unresolvedExpr'.
An 'unresolvedExpr' encapsulates the eventual evaluation result.
Query its $data
element for resolution. Once resolved, the object
changes into a 'resolvedExpr' and the evaluated result will be available
at $data
.
Supports stringing together a series of piped expressions (as per the below example).
unresolved
may be used on an 'unresolvedExpr' or its
$data
element to test for resolution.
Usage is similar to R's native |>
pipe.
x %>>% f
is equivalent to f(x)
x %>>% f()
is equivalent to f(x)
x %>>% f(y)
is equivalent to f(x, y)
Please note that other usage is not supported and it is not a drop-in
replacement for magrittr's %>%
pipe.
if (interactive()) {
# Only run examples in interactive R sessions
m <- mirai({Sys.sleep(0.5); 1})
b <- m$data %>>% c(2, 3) %>>% as.character()
b
b$data
call_mirai(m)
b$data
b
}