Compose.attach: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/compose.bend as Compose Lines 333-345 of yaml-for-bend@0.1.1.0/compose.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/compose.bend&start_line=333&end_line=345 import Base # A finished node goes to the collection it's in, or is the document. def attach(co: Co, item: Item) -> Co: match co: case Co{stack, anchors, count, root, docs, opened, depth, copied}: match stack: case Nil{}: Co{[], anchors, count, Some{item.val(item)}, docs, opened, depth, copied} case Con{top, rest}: match top: case OSeq{anchor, tag, items, start, at}: Co{OSeq{anchor, tag, item.val(item) <> items, start, at} <> rest, anchors, count, root, docs, opened, depth, copied} case OMap{anchor, tag, items, start, at}: Co{OMap{anchor, tag, item <> items, start, at} <> rest, anchors, count, root, docs, opened, depth, copied} Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=Co https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=Item https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=Open https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/compose.bend&name=item.val