module Entier = struct type t = int let comp x y = x - y end module Chaine = struct type t = string let rec comprec s1 s2 i = if String.length s1 <= i then if String.length s2 <= i then 0 else -1 else if String.length s2 <= i then 1 else if s1.[i] = s2.[i] then comprec s1 s2 (i+1) else (int_of_char s1.[i]) - (int_of_char s2.[i]) let comp s1 s2 = comprec s1 s2 0 end let _ = Entier.comp 2 4 let _ = Chaine.comp "aze" "aye"