lean4-htt/tests/compiler/partial.lean
Leonardo de Moura 3862e7867b refactor: make String.Pos opaque
TODO: this refactoring exposed bugs in `FuzzyMatching` and `Lake`

closes #410
2022-03-20 10:47:13 -07:00

14 lines
350 B
Text

--
set_option pp.explicit true
-- set_option trace.compiler.boxed true
partial def contains : String → Char → String.Pos → Bool
| s, c, i =>
if s.atEnd i then false
else if s.get i == c then true
else contains s c (s.next i)
def main : IO Unit :=
let s1 := "hello";
IO.println (contains s1 'a' 0) *>
IO.println (contains s1 'o' 0)