def length
import bendtorch-core@0.1.0.0/src/storage/main.bend as BendtorchCoreimport Base
122def length(storage: Storage) -> Storage & Nat:
123 match storage:
124 case Empty{}:
125 (Empty{}, 0n)
126 case Owned{+d, +n, array, balanced, valid}:
127 (Owned{d, n, array, balanced, valid}, n)