fn(commits$0, index$1, latest$2, environment$3, resolutions$11, fresh$12, then$4) =>
match @core.list-get(list: $0, index: $1) {
#none(_) =>
$4(latest: $2, environment: $3, fresh: $12),
#some(commit$5) =>
@definy.resolve-snapshot-contents(
parts: $5.parts,
then: fn(parts$6, fresh$13) =>
@definy.resolve-latest-snapshots(
commits: $0,
index: @core.plus(left: $1, right: 1),
latest: @core.list-concat(
left: $2,
right: @core.list-map(
T: @definy.snapshot-check-part,
U: @definy.type-check-entry,
f: fn(item$7) =>
match @definy.resolution-for(resolutions: $11, content_hash: $7.content_hash) {
#some(hit$14) =>
{
part_id: $7.id,
module_id: $7.module_id,
part_type: $14.entry.part_type,
type_declaration: $14.entry.type_declaration,
expression_key: $14.entry.expression_key,
has_expression: $14.entry.has_expression,
references: $14.entry.references
},
#none(_) =>
@definy.latest-type-check-entry(part: $7)
},
xs: $6
)
),
environment: @core.list-concat(
left: $3,
right: @core.list-map(
T: @definy.snapshot-check-part,
U: @core.visibility-target,
f: fn(item$8) =>
@definy.latest-visibility-target(project_name: $5.project_name, part: $8),
xs: $6
)
),
then: fn(latest$9, environment$10, fresh$15) =>
$4(latest: $9, environment: $10, fresh: $15),
resolutions: $11,
fresh: @core.list-concat(left: $12, right: $13)
),
resolutions: $11
)
}