def snap.heap

bend-kit-runner@0.13.0.1 · runner.bend:571

import bend-kit-runner@0.13.0.1/runner.bend as Runner
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes
import bend-kit-scheduler@0.4.1.0/queue.bend as Q
import bend-kit-collections@0.1.4.1/heap.bend as H

571def snap.heap(~A: Data, ~penc: A -> Bytes.Bytes, h: H.Heap<Q.Ticket<A>>, out: Bytes.Bytes) -> Bytes.Bytes:
572  match h:
573    case H.HLeaf{}:
574      snap.u32(out, 0)
575    case H.HNode{+n, t, l, r}:
576      snap.heap(~A, ~penc, r, snap.heap(~A, ~penc, l, snap.ticket(~A, ~penc, snap.u64(snap.u32(out, 1), n), t)))

Uses (6)

Used by (1)