sort-list
Translation status: English reader-locale proof. Term names and code fences follow the en pack; supporting prose may still be English.
Syntax:
Category#
collection
Related#
None.
Examples#
radix/corpus/sort/list-asc-desc.fab (canonical · concept)#
# sort via asc|desc from <list> builds a new list; the source is unchanged.
main {
let list<int> xs ← [3, 1, 2, 3, 0]
let list<int> up ← sort via asc from xs
let list<int> down ← sort via desc from xs
print up
print down
print xs
}Expected output:
[0, 1, 2, 3, 3]
[3, 3, 2, 1, 0]
[3, 1, 2, 3, 0]