Skip to content

Nullable and NullableM

Андрей Мулик edited this page Sep 21, 2023 · 2 revisions

Nullable and NullableM

Nullable - a class of types with immutable shape that have a neutral element regarding the concatenation.

NullableM - a class of types with mutable shape that have a neutral element regarding the concatenation.

Nullable - special case of NullableM.

Historical reference

The Nullable class was separated from Linear in sdp-0.2, and NullableM from LinearM in sdp-0.3.

API

Method Nullable Added NullableM Added
Neutral element lzero 0.2 newNull 0.3
Check for neutral element isNull 0.2 nowNull 0.3

If the type implements Eq, then comparing the value with lzeromust be equivalent toisNull`. If a type has several neutral elements by concatenation, then they must all be equal to each other.