fn(item$0) =>
match $0 {
#integer(number$1) =>
match @core.less-than(left: $1, right: 0) {
true =>
@cbor.head-bytes(major: 1, value: @core.minus(left: @core.minus(left: 0, right: 1), right: $1)),
false =>
@cbor.head-bytes(major: 0, value: $1)
},
#bytes(bytes$2) =>
@core.list-concat(left: @cbor.head-bytes(major: 2, value: @core.list-length(value: $2)), right: $2),
#text(text$3) =>
let utf8$4 = @core.string-to-bytes(value: $3);
@core.list-concat(left: @cbor.head-bytes(major: 3, value: @core.list-length(value: $4)), right: $4),
#array(items$5) =>
@core.list-concat(
left: @cbor.head-bytes(major: 4, value: @core.list-length(value: $5)),
right: @cbor.encode-items(items: $5, start: 0, end: @core.list-length(value: $5))
),
#map(entries$6) =>
@core.list-concat(
left: @cbor.head-bytes(major: 5, value: @core.list-length(value: $6)),
right: @cbor.encode-entries(entries: $6, start: 0, end: @core.list-length(value: $6))
),
#tagged(tagged$7) =>
@core.list-concat(left: @cbor.head-bytes(major: 6, value: $7.tag), right: @cbor.encode(item: $7.value)),
#simple(number$8) =>
@cbor.head-bytes(major: 7, value: $8),
#float(float$9) =>
@core.list-concat(
left: [@core.plus(left: 224, right: $9.info)],
right: @cbor.uint-bytes(
value: $9.bits,
count: match @core.equal(left: $9.info, right: 25) {
true =>
2,
false =>
match @core.equal(left: $9.info, right: 26) {
true =>
4,
false =>
8
}
}
)
)
}