Source/Packages

Std.Word

packages/foundation/standard/src/Std/Word.alpha

1,783 lines192 declarations64.2 KiBSHA-256 27bf8c3f30ee

def · lines 874–881

stdU8AddWrapping

Full file
U8 ARITHMETIC (L11p, REG-012): the owner is Std.Byte's byteAddWithCarry (low byte + carry flag). Wrapping keeps the low byte; checked is absent exactly when the carry is set (255 + 1 -> None; 254 + 1 -> Some 255).
874def stdU8AddWrapping =
875  (lambda unrestricted a : Byte .
876    (lambda unrestricted b : Byte .
877      (eliminate
878        ByteAddResult
879        (lambda unrestricted current : (family ByteAddResult) . Byte)
880        (byteAddWithCarry a b zero)
881        (branch ByteAddResultValue low carry . low))))

The compiler supplied declaration spans and resolved links from this source snapshot. This page does not assert that this file belongs to a checked closure.