% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/30-api-flexseq-core.R
\name{flexseq}
\alias{flexseq}
\title{Construct a Persistent Flexible Sequence}
\usage{
flexseq(...)
}
\arguments{
\item{...}{Sequence elements.}
}
\value{
A \code{flexseq} object.
}
\description{
\code{flexseq(...)} creates an immutable sequence from \code{...}, preserving element
order and optional names, with efficient persistent updates.
}
\details{
It is list-like in payload flexibility (any R object per element), but
sequence-oriented in API (\verb{push_*}, \verb{peek_*}, \verb{pop_*}, indexing, split/concat).

\code{flexseq} is the base general-purpose structure in this package.
Specialized structures such as \code{priority_queue}, \code{ordered_sequence}, and
\code{interval_index} build on related internals but expose narrower semantics.

\code{flexseq} operations are persistent: updates return new objects and do not
mutate prior versions.
}
\examples{
x <- flexseq(1, 2, 3)
x

y <- push_front(x, 0)
y
x  # unchanged

named <- flexseq(a = 1, b = 2)
named
named[["a"]]
}
\seealso{
\code{\link[=as_flexseq]{as_flexseq()}}, \code{\link[=priority_queue]{priority_queue()}}, \code{\link[=ordered_sequence]{ordered_sequence()}}, \code{\link[=interval_index]{interval_index()}}
}
