mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 17:25:31 +03:00
12 lines
379 B
Plaintext
12 lines
379 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) // FIXME: handle unbound reference
|
|
(~found P some none)
|