def AaText.prefix

bend-osdev-apparmor@0.1.0.0 · text.bend:87

import bend-osdev-apparmor@0.1.0.0/text.bend as Text
import Base

87# xs begins with ys
88def AaText.prefix(xs: List<&2, U32>, ys: List<&2, U32>) -> Bool:
89  match xs ys:
90    case Nil{} Nil{}:
91      True{}
92    case Nil{} Con{c, t}:
93      False{}
94    case Con{h, t} Nil{}:
95      True{}
96    case Con{h, t} Con{c, u}:
97      Bool.and(U32.is_eq(h, c), AaText.prefix(t, u))

Uses (5)

Used by (1)