nustack
ReferenceNulang

sentinels

Sentinels - EMPTY and INVALID.

Module nu.lang.sentinels.

Sentinels - EMPTY and INVALID.

EMPTY originates only at Ref resolution (the address resolves to nothing). INVALID originates when an operation is applied to an EMPTY operand. If any operand of a Query is EMPTY or INVALID, the Query returns INVALID - sentinels collapse to INVALID upward through Query chains.

Sentinel-check ops (IsEmpty, IsInvalid) bypass propagation: they accept any value and return Bool. In a Stream, a sentinel is just one yielded value; the stream consumer decides what it means per element.

NameCallMeaning
is_emptylang.is_empty(value)True if value is the EMPTY sentinel.
is_invalidlang.is_invalid(value)True if value is the INVALID sentinel.
is_sentinellang.is_sentinel(value)True if value is any Sentinel.

is_empty

True if value is the EMPTY sentinel.

lang.is_empty(value)

Path nu.lang.is_empty. Defined on nu.lang.sentinels, bound as a function. Builds TypeGuard[Empty].

Arguments

NameTypeDefaultMeaning
valueobject

Undocumented: example.

is_invalid

True if value is the INVALID sentinel.

lang.is_invalid(value)

Path nu.lang.is_invalid. Defined on nu.lang.sentinels, bound as a function. Builds TypeGuard[Invalid].

Arguments

NameTypeDefaultMeaning
valueobject

Undocumented: example.

is_sentinel

True if value is any Sentinel.

lang.is_sentinel(value)

Path nu.lang.is_sentinel. Defined on nu.lang.sentinels, bound as a function. Builds TypeGuard[Sentinel].

Arguments

NameTypeDefaultMeaning
valueobject

Undocumented: example.

On this page