def decode.go
import bend-kit-http2@0.4.0.0/huffman.bend as Huffmanimport Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
1267def decode.go(n: Nat, b: Bytes.Bytes, +at: U32, d: Decoder) -> Maybe<&2, Decoder>:
1268 match n:
1269 case 0n:
1270 Some{d}
1271 case 1n+p:
1272 with_number(Maybe<&2, Decoder>, Bytes.get(b, at), b => byte =>
1273 do Maybe<&2, Decoder>:
1274 next: Decoder <- decode.step(8n, byte, d)
1275 decode.go(p, b, (at + 1 : U32), next))