fn(queue$0, index$1, result$2, then$3) =>
match @core.list-get(list: $0, index: $1) {
#none(_) =>
$3(ancestors: $2),
#some(hash$4) =>
@definy.read-snapshot-content(
event_hash: $4,
then: fn(commit$5) =>
match $5 {
#none(_) =>
@definy.merge-ancestors(
queue: $0,
index: @core.plus(left: $1, right: 1),
result: $2,
then: fn(ancestors$8) =>
$3(ancestors: $8)
),
#some(content$6) =>
@definy.merge-ancestors(
queue: @definy.merge-push-hash(list: @definy.merge-push-hash(list: $0, hash: $6.parent_commit_hash), hash: $6.merged_commit_hash),
index: @core.plus(left: $1, right: 1),
result: @core.list-append(list: $2, item: $4),
then: fn(ancestors$7) =>
$3(ancestors: $7)
)
}
)
}