R/30-api-flexseq-empty-tree.R

Defines functions empty_tree

Documented in empty_tree

#SO

#' Create an Empty Structural Tree
#'
#' @param monoids Optional named list of `measure_monoid` objects.
#' @return An empty finger tree with structural `monoids` and `measures` attrs.
#' @keywords internal
# Runtime: O(1).
empty_tree <- function(monoids = NULL) {
  ms <- if(is.null(monoids)) {
    list(.size = size_measure_monoid())
  } else {
    ensure_size_monoids(monoids)
  }
  measured_empty(ms)
}

Try the Immutables package in your browser

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

Immutables documentation built on April 29, 2026, 1:06 a.m.