fn(parts$0, index$1, entries$2, then$3) =>
match @core.list-get(list: $0, index: $1) {
#none(_) =>
match @core.equal(left: @core.list-length(value: $2), right: 0) {
true =>
$3(),
false =>
#write_cached_resolutions({
version: @definy.resolution-cache-version,
entries: $2,
then: fn(written$7) =>
$3()
})
},
#some(part$4) =>
match $4.content {
#none(_) =>
@definy.write-resolutions(
parts: $0,
index: @core.plus(left: $1, right: 1),
entries: $2,
then: fn() =>
$3()
),
#some(content$5) =>
@definy.write-resolutions(
parts: $0,
index: @core.plus(left: $1, right: 1),
entries: @core.list-append(
list: $2,
item: {
content_hash: $4.content_hash,
content: $5,
entry: @definy.content-type-check-entry(part_id: $4.id, module_id: $4.module_id, content_hash: $4.content_hash, content: $5)
}
),
then: fn() =>
$3()
)
}
}