type ('a) list = Cons of 'a * ('a) list | Nil ;; let rec APPEND v3 = (fun v4 -> (match v3 with Nil -> v4 | (Cons (v2, v1)) -> (Cons (v2, ((APPEND v1) v4))))) ;; type ('a, 'b) prod = Pair of 'a * 'b ;; let rec PART v3 = (fun v4 -> (fun v5 -> (fun v6 -> (match v4 with Nil -> (Pair (v5, v6)) | (Cons (v2, v1)) -> (if (v3 v2) then ((((PART v3) v1) (Cons (v2, v5))) v6) else ((((PART v3) v1) v5) (Cons (v2, v6)))))))) ;; let PARTITION = (fun v1 -> (fun v2 -> ((((PART v1) v2) Nil) Nil))) ;; let rec QSORT v7 = (fun v8 -> (match v8 with Nil -> Nil | (Cons (v6, v5)) -> (let v3 = ((PARTITION (fun v4 -> ((v7 v4) v6))) v5) in (match v3 with (Pair (v2, v1)) -> ((APPEND ((APPEND ((QSORT v7) v2)) (Cons (v6, Nil)))) ((QSORT v7) v1)))))) ;;