let head = function | [] -> failwith "Empty list" | x::xs -> x let tail = function | [] -> failwith "Empty list" | x::xs -> xs let rec length = function | [] -> 0 | x::xs -> 1 + length xs;;