mirror of
https://github.com/HigherOrderCO/Kind.git
synced 2024-09-11 20:47:25 +03:00
16 lines
516 B
Plaintext
16 lines
516 B
Plaintext
Kind.load.name
|
|
: ∀(name: String) ∀(book: Kind.Book) (IO Kind.Book)
|
|
= λname λbook
|
|
(IO.bind
|
|
Kind.Book
|
|
Kind.Book
|
|
(Kind.load.code name)
|
|
λfile
|
|
let defs = (String.Map.to_list Kind.Term file)
|
|
let fold = (List.fold (Pair String Kind.Term) defs)
|
|
let set2 = λnam λval (String.Map.set Kind.Term nam val book)
|
|
let setP = λdef λbook (~def λx Kind.Book set2)
|
|
let book = (fold Kind.Book setP book)
|
|
let deps = (Kind.Book.get_refs file)
|
|
(Kind.load.dependencies deps book)
|
|
) |