let nth_exn t n = match nth t n with | None -> ksprintf invalid_arg "List.nth_exn %d called on list of length %d" n (length t) | Some a -> a