def Yaml.fold
import bend-kube-runtime@0.2.0.0/src/yaml.bend as Yamlimport Base
168# Folded lines: a line break between two text lines becomes a space; blank
169# lines stay line breaks.
170def Yaml.fold(xs: List<&2, String>, prev: Bool) -> String:
171 match xs:
172 case Nil{}:
173 ""
174 case Con{SNil{}, t}:
175 "\n" ++ Yaml.fold(t, False{})
176 case Con{l, t}:
177 Yaml.fold.sep(prev) ++ l ++ Yaml.fold(t, True{})