#' Are Some or No Values True?
#'
#' Given a set of logical vectors, check if some or all values false.
#'
#' These functions are to compliment \code{\link[base:all]{all}} and \code{\link[base:any]{any}}. Refer to the respective help pages for those functons for more details.
#' @param ... zero or more logical vectors. Other objects of zero length are ignored, and the rest are coerced to logical ignoring any class.
#' @param na.rm	logical: if true, NA values are removed before the result is computed.
#' @return
#' \describe{ 
#' \item{\code{some}}{returns \code{TRUE} only if some but not all values are \code{TRUE}. If no values provided, \code{FALSE} is returned. If the values provided include one or more \code{NA} values, \code{TRUE} is still only returned if at least one \code{TRUE} and one \code{FALSE} values. Otherwise \code{NA} is returned (unless \code{na.rm = TRUE}).}
#' \item{\code{none}}{returns \code{TRUE} only if no value is \code{TRUE}, including when no values provided. The latter is the distinction from \code{!all()}, which returns \code{FALSE} when no values are provided. If the values provided include one or more \code{NA} values, \code{FALSE} is returned if at least one value is \code{TRUE}. Otherwise \code{NA} is returned (unless \code{na.rm = TRUE}).}
#' }
#' @name checks
#' @examples
#' some(c(T, F, F)) # TRUE
#' some(c(T, T, T)) # FALSE because all TRUE
#' some(c(F, F, F)) # FALSE
#' some()           # FALSE 
#'
#' none(c(F, F, F)) # TRUE
#' none(c(T, F, F)) # FALSE
#' none()           # TRUE
NULL

#' @rdname checks
#' @export
some <- function(..., na.rm = FALSE) {
	any(..., na.rm = na.rm) && !all(..., na.rm = na.rm)
}

#' @rdname checks
#' @export
none <- function(..., na.rm = FALSE) {
	is.null(c(...)) || !any(..., na.rm = na.rm)
}
