let length l = let rec length' c = function | h :: t -> length' (c + 1) t | [] -> 0 length' 0 l length [ "a" ; "b" ; "c" ; "d" ] length [ "a" ; "b" ; "c" ; "d" ] length [ "a" ] length ([ ] : int list)