def huff.fixed.lengths
import gralha-bytes@0.1.0.1/bytes.bend as Bytesimport Base
import gralha-text-scan@0.1.0.1/scan.bend as U
200def huff.fixed.lengths(n: Nat, +index: U32, out: Bytes) -> Bytes:
201 match n:
202 case 0n: out
203 case 1n+d: huff.fixed.lengths(d, U32.inc(index), bytes.push(out, U.choose(U32, U32.is_lt(index, 144), 8, U.choose(U32, U32.is_lt(index, 256), 9, U.choose(U32, U32.is_lt(index, 280), 7, 8)))))