R/methods.R

Defines functions print.promise format.promise

#' @export
format.promise <- function(x, ...) {
  p <- attr(x, "promise_impl", exact = TRUE)
  p$format()
}

#' @export
print.promise <- function(x, ...) {
  cat(paste(format(x), collapse = "\n"), "\n", sep = "")
}

Try the promises package in your browser

Any scripts or data that you put into this service are public.

promises documentation built on June 8, 2025, 1:12 p.m.