Type-level bubble sort algorithm in Rust Read the article about the implementation: link! assert_type_eq!( BubbleSort<Cons<N3, Cons<N1, Cons<N2, Nil>>>>, Cons<N1, Cons<N2, Cons<N3, Nil>>>);