def take_chars
import cswap-bend-cli@0.1.0.0/tui/fmt.bend as Fmtimport Base
103# The first `n` characters of a line.
104def take_chars(+l: List<&2, Seg>, +n: Nat) -> List<&2, Seg>:
105 match l:
106 case Nil{}:
107 Nil{}
108 case Con{s, t}:
109 take_pick(Nat.is_gt(seg_len(s), n), s, n, take_chars(t, Nat.sub(n, seg_len(s))))