def text.at
gralha-svg-render@0.1.0.1 · svg.bend:3228
import gralha-svg-render@0.1.0.1/svg.bend as Svg
import Base
import gralha-text-scan@0.1.0.1/scan.bend as U
3228def text.at(xs: List<&2, F32>, +index: U32, +repeat: Bool, previous: TextValue) -> TextValue:
3229 match xs:
3230 case Nil{}: U.choose(TextValue, repeat, previous, TextValue{0.0, False{}})
3231 case Con{head, tail}:
3232 +h = head
3233 U.branch(TextValue, U32.is_eq(index, 0), _ => TextValue{h, True{}}, _ => text.at(tail, (index - 1 : U32), repeat, TextValue{h, True{}}))