fn(modules$0, count$1) =>
match @core.list-get(list: $0, index: 0) {
#none(_) =>
#object<@definy.json>([{key: "count", value: #number<@definy.json>($1)}]),
#some(module$2) =>
#object<@definy.json>([
{key: "count", value: #number<@definy.json>($1)},
{
key: "description",
value: #string<@definy.json>(@core.list-fold(
T: @core.localized-text,
A: String,
reducer: fn(acc$3, item$4) =>
match @core.or(left: @core.equal(left: $4.language, right: "en"), right: @core.equal(left: $3, right: "")) {
true =>
$4.text,
false =>
$3
},
init: "",
xs: $2.description
))
},
{key: "descriptions", value: @html-ui.descriptions-json(texts: $2.description)},
{
key: "visibility",
value: #string<@definy.json>(match $2.visibility {
#public(_) =>
"public",
#private(_) =>
"private"
})
}
])
}