1use <prelude.kav>
2use <list.kav> as list
3
4pub fn main() -> int {
5 val l: list::List[int, 3] = list::Cons(1, list::Cons(2, list::Cons(3, list::Nil)))
6 val reversed = list::reverse(l)
7 case reversed of {
8 | ~list::Cons(x, rest) => {
9 val _ = list::free(rest)
10 x
11 }
12 }
13}