System.Collections.Immutable by Microsoft

<PackageReference Include="System.Collections.Immutable" Version="7.0.0-preview.3.22175.4" />

.NET API 194,704 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.