Kind/book/String.skip.kind2
2024-02-12 22:39:06 -03:00

15 lines
422 B
Plaintext

// TODO: implement comment skipper
String.skip
: ∀(str: String)
String
= λstr
let P = λx(String)
let cons = λhead λtail
let skip = (Char.is_whitespace head)
let P = λx ∀(head: Char) ∀(tail: String) (String)
let true = λhead λtail (String.skip tail)
let false = λhead λtail (String.cons head tail)
(~skip P true false head tail)
let nil = String.nil
(~str P cons nil)