Skip to contents

Returns the first element without modifying the sequence.

Usage

peek_front(x)

Arguments

x

A flexseq.

Value

First element, or NULL when x is empty.

Details

Returns the payload element without modifying x.

Examples

x <- flexseq("a", "b", "c")
peek_front(x)
#> [1] "a"

peek_front(flexseq())
#> NULL