def text.pad_right
import ezsys@0.1.0.0/src/str.bend as Strimport Base
434# the text with spaces after it up to `n` code points; a longer text is
435# kept whole
436def text.pad_right(txt: String, width: Nat) -> String:
437 match txt width:
438 case SNil{} k:
439 String.repeat(" ", k)
440 case SCon{h, t} 0n:
441 SCon{h, t}
442 case SCon{h, t} 1n+k:
443 SCon{h, text.pad_right(t, k)}