Source/Packages

Std.Bytes

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

71 lines7 declarations3.2 KiBSHA-256 6f979afb4a88

def · lines 49–58

bytesDrop

Full file
Total range mechanisms: dropping past the end returns empty; the prefix builder pads with zero bytes past the end. Bounded codecs must admit ranges before calling these. Structural compiler lowering preserves these laws.
49def bytesDrop =
50  (lambda unrestricted count : Nat .
51    nat-eliminate
52      (lambda unrestricted current : Nat . pi unrestricted input : Bytes . Bytes)
53      (lambda unrestricted input : Bytes . input)
54      (lambda unrestricted predecessor : Nat .
55        unrestricted induction : (pi unrestricted input : Bytes . Bytes) .
56        unrestricted input : Bytes .
57        induction (bytes-tail input))
58      count)

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.