def lines_go
near-v-framework@0.4.0.0 · domain/architecture/system/deployment/nix_darwin/effects.bend:26
import near-v-framework@0.4.0.0/domain/architecture/system/deployment/nix_darwin/effects.bend as Effects
import Base
26def lines_go(s: String, +line: String, +acc: List<&2, String>) -> List<&2, String>:
27 match s:
28 case SNil{}:
29 unreverse(line <> acc, [])
30 case SCon{+c, t}:
31 +nl = Char.is_eq(c, '\n')
32 lines_go(t, Bool.pick(String, nl, "", SCon{c, line}), Bool.pick(List<&2, String>, nl, line <> acc, acc))