Http.octs.has: def of emerging-ezhttp@0.21.0.0 Import: import emerging-ezhttp@0.21.0.0/src/http.bend as Http Lines 237-245 of emerging-ezhttp@0.21.0.0/src/http.bend: https://jend.leeeet.dev/read.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&start_line=237&end_line=245 import Base # whether a string is at least this many bytes of UTF-8, walking no further # than that many (octs.len walks all of it) def octs.has(s: String, +n: Nat) -> Bool: match s: case SNil{}: Bool.not(Nat.is_lt(0n, n)) case SCon{+h, t}: +w = octs.width(Char.to_u32(h)) octs.has.step(Nat.is_lt(n, w), _u => octs.has(t, Nat.sub(n, w))) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.not https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char.to_u32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.sub https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=octs.has.step https://jend.leeeet.dev/definition.txt?path=emerging-ezhttp@0.21.0.0/src/http.bend&name=octs.width