module Isort; def Bool compare_list (List l1, List l2) = case l1 { Nil => True; Cons(x,xs) => case l2 { Nil => False; Cons(y,ys) => if x==y then compare_list(xs,ys) else x < y; }; }; def Bool le(Int i1, Int i2) = i1 <= i2; def List insert(le)(Int x, List l) = case l { Nil => Cons(x, Nil); Cons(y, ys) => if le(y, x) then Cons(y,insert(x, ys)) else Cons(x, Cons(y, ys)); }; def List isort(le)(List l) = case l { Nil => Nil; Cons(x,xs) => insert(le)(x, isort(xs)); }; def List start(List l) = isort(le)(l); { }