类型的错误(无界的构造函数,没有构造函数),我要让作用这样的功能:的函数参数,ocaml的
('a, 'a) >>>> ('a list, 'a list) >>>> ('a list, 'a list)
例如,
append_list (1, 2) ([10, 3], []) >>>> ([1, 10, 3], [2])
我有两个错误
错误1
let append_list (a, b) (A, B) =
(a::A, b::B);;
Error: Unbound constructor A
误差2
let append_list (a, b) ((A : 'a list), (B : 'a list)) =
(a::A, b::B);;
Error: The variant type list has no constructor A
如何让正确的功能?
作为接受您可以标记自己的答案。 –