(* fil : Pivot-Filter fŸr QuickSort *) let rec fil p l = match l with (x::xs) -> if (p x) then x::(fil p xs) else fil p xs | [] -> [];; (* qs : QuickSort *) let rec qs l = match l with (x::xs) -> qs (fil (function z -> z < x) xs) @ [x] @ qs (fil (function z -> z >= x) xs) | [] -> [];;