% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/s3.R
\name{done}
\alias{done}
\alias{is_done_box}
\title{Box a final value for early termination}
\usage{
done(x)

is_done_box(x, empty = NULL)
}
\arguments{
\item{x}{For \code{done()}, a value to box. For \code{is_done_box()}, a
value to test.}

\item{empty}{Whether the box is empty. If \code{NULL}, \code{is_done_box()}
returns \code{TRUE} for all done boxes. If \code{TRUE}, it returns \code{TRUE}
only for empty boxes. Otherwise it returns \code{TRUE} only for
non-empty boxes.}
}
\value{
A \link[=new_box]{boxed} value.
}
\description{
A value boxed with \code{done()} signals to its caller that it
should stop iterating. Use it to shortcircuit a loop.
}
\examples{
done(3)

x <- done(3)
is_done_box(x)
}
