let rec at i = function | h :: t when 1 < i -> at (i - 1) t | h :: t when 1 = i -> Some h | _ -> None at 2 [ "a" ; "b" ; "c" ; "d" ] at -1 [ "a" ; "b" ; "c" ; "d" ] at 2 [ "a" ] at 2 ([ ] : int list)