print.FingerTree: Print a compact summary of a finger tree

View source: R/30-api-flexseq-print.R

print.FingerTreeR Documentation

Print a compact summary of a finger tree

Description

Print a compact summary of a finger tree

Usage

## S3 method for class 'FingerTree'
print(x, max_elements = 4L, show_custom_monoids = FALSE, ...)

## S3 method for class 'Deep'
print(x, ...)

## S3 method for class 'Single'
print(x, ...)

## S3 method for class 'Empty'
print(x, ...)

Arguments

x

FingerTree.

max_elements

Maximum number of elements shown in preview (head + tail). Default 4.

show_custom_monoids

Logical; show attached non-default monoids and their root cached measures. Default FALSE.

...

Passed through to print() for preview elements.

Value

x, invisibly.

Examples

x <- as_flexseq(setNames(as.list(1:6), letters[1:6]))
print(x, max_elements = 4)
sum_m <- measure_monoid(`+`, 0, function(el) as.numeric(el))
print(add_monoids(as_flexseq(1:3), list(sum = sum_m)), max_elements = 0, show_custom_monoids = TRUE)

y <- as_flexseq(as.list(1:6))
print(y, max_elements = 3)

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