从列表列表中获取元素 ocaml

Get element from list of lists ocaml

我在获取列表中第 n 个列表的数学元素时遇到问题。我做了这个功能:

let pos tabla n m = 
let lista = (List.nth tabla n)
in
    List.nth lista m;;

这总是 return 个错误。

我觉得还不错:

utop # pos [[1;2];[3]] 1 0;; - : int = 3

可以从 1 开始数吗?