List.swap_head: def of bendlib-kernel-list@1.0.0.0 Import: import bendlib-kernel-list@1.0.0.0/list.bend as List Lines 5-15 of bendlib-kernel-list@1.0.0.0/list.bend: https://jend.leeeet.dev/read.txt?path=bendlib-kernel-list@1.0.0.0/list.bend&start_line=5&end_line=15 import Base # Swap the first two elements (no-op on lists shorter than two). def swap_head(-A: Data, xs: List<&2, A>) -> List<&2, A>: match xs: case Nil{}: Nil{} case +x <> t: match t: case Nil{}: x <> Nil{} case +y <> u: y <> x <> u Uses (1): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List