I was curious about the examples but this does not seem promising...
def sort(list: List(T)): List(T) where Ord(T) = match list do [] -> [] [pivot | rest] -> sort(rest) end