Bendtorch.OptState.join: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 89-96 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=89&end_line=96 import Base # Pair the buffers present on both sides. Internal callers split one state, then step both children with the same # optimizer, so the variants agree. No buffer is ever allocated to fill an absent side. def OptState.join(-A: Type, -B: Type, a: OptState, b: OptState) -> OptState>: match a b: case OneMom{x} OneMom{y}: OneMom{Two{x, y}} case TwoMom{x, u} TwoMom{y, v}: TwoMom{Two{x, y}, Two{u, v}} case Packed{x} Packed{y}: Packed{PNode{x, y}} case _ _: NoMom{} Uses (3): https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=OptState https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=PTree https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Two