def word

ezx@1.11.0.0 · src/pkg/pkg.bend:157

import ezx@1.11.0.0/src/pkg/pkg.bend as Pkg
import Base

157# the nth word, or "" when the line is shorter than that. Both the list and the
158# count are scrutinised together, so the walk needs no helper to branch through.
159def word(ws: List<&2, String>, index: Nat) -> String:
160  match ws index:
161    case Nil{} _m:
162      ""
163    case Con{h, _t} 0n:
164      h
165    case Con{_h, t} 1n+p:
166      word(t, p)

Uses (3)

Used by (13)