fn(target$0, referrers$1, to_module$2, to_name$3, new_id$4) =>
@core.list-fold(
T: @definy.snapshot-check-part,
A: Union{#ok(List<@definy.mcp-part-upload>), #error(String)},
reducer: fn(acc$7, item$8) =>
match $7 {
#error(message$9) =>
#error($9),
#ok(uploads$10) =>
match @definy.renamed-content-item(part: $8, from: $0.id, to: $4) {
#none(_) =>
#error(@core.string-concat(left: "The content of the part could not be read: ", right: $8.name)),
#some(item$11) =>
#ok(@core.list-append(
list: $10,
item: @definy.mcp-part-upload-of(
module_name: $8.module_name,
name: @definy.part-bare-name(module_name: $8.module_name, name: $8.name),
content: #some($11)
)
))
}
},
init: match @definy.renamed-content-item(part: $0, from: $0.id, to: $4) {
#none(_) =>
#error(@core.string-concat(left: "The content of the part could not be read: ", right: $0.name)),
#some(item$12) =>
#ok([
@definy.mcp-part-upload-of(module_name: $2, name: $3, content: #some($12)),
@definy.mcp-part-upload-of(
module_name: $0.module_name,
name: @definy.part-bare-name(module_name: $0.module_name, name: $0.name),
content: #none
)
])
},
xs: $1
)