System.Collections.Immutable by Microsoft

<PackageReference Include="System.Collections.Immutable" Version="9.0.0-preview.1.24080.9" />

.NET API 253,616 bytes

 IImmutableStack<T>

public interface IImmutableStack<T> : IEnumerable<T>, IEnumerable
Represents an immutable last-in-first-out (LIFO) collection. NuGet package: System.Collections.Immutable (about immutable collections and how to install)
bool IsEmpty { get; }

Gets a value that indicates whether this immutable stack is empty.

Removes all objects from the immutable stack.

T Peek()

Returns the element at the top of the immutable stack without removing it.

Removes the element at the top of the immutable stack and returns the new stack.

IImmutableStack<T> Push(T value)

Inserts an element at the top of the immutable stack and returns the new stack.