let is_valid = let rec loop s = function | [] -> true | a :: al -> (match add s a with | Status.Valid _ -> loop s al | _ -> false) in loop