public T HeadGets the guaranteed first element without throwing.
All Types / Ferrous.Results
public sealed class NonEmptyList<T> : IReadOnlyList<T>
An immutable, read-only list guaranteed to contain at least one element (Head).
Tpublic T HeadGets the guaranteed first element without throwing.
public int Countpublic static NonEmptyList<T> Create(T head, params T[] tail)Creates a NonEmptyList<T> from a guaranteed head element and optional tail elements.
public static Option<NonEmptyList<T>> TryCreate(IEnumerable<T>? source)Creates a NonEmptyList<T> if source contains at least one element; otherwise Option<T>.None.
public IEnumerator<T> GetEnumerator()