【发布时间】:2020-01-26 08:13:22
【问题描述】:
我需要输出一对列表,但我不明白为什么我返回的这对不是正确的类型。
let rec split l = match l with
| [] -> []
| [y] -> [y]
| x :: xs ->
let rec helper l1 acc = match l1 with
| [] -> []
| x :: xs ->
if ((List.length xs) = ((List.length l) / 2)) then
(xs, (x :: acc))
else helper xs (x :: acc)
in helper l []
【问题讨论】:
标签: ocaml