Kind/book/Kind.Scope.find.kind2
2024-03-01 20:40:31 -03:00

9 lines
331 B
Plaintext

Kind.Scope.find
: ∀(nam: String) ∀(scp: Kind.Scope) Kind.Term
= λname λscope
let cond = λbnd (~bnd λx Bool λn λt (String.equal name n))
let found = (List.find Kind.Binder cond scope)
let P = λx Kind.Term
let some = λbnd (~bnd λx Kind.Term λn λt t)
let none = (Kind.ref name Kind.set)
(~found P some none)