let rec split_list_at_nth n l =
  if n = 0 then [], l
  else
    match l with
      hd::tl ->
        let rest, l = split_list_at_nth (n-1) tl in
        hd::rest, l
    | [] ->
        [], []