我有这个代码
type Tree<'T when 'T: comparison> =
| Empty
| Node of 'T * Tree<'T> * Tree<'T>
let rec insert value = function
| Empty -> Node(value, Empty, Empty)
| Node(v, left, right) when value < v -> Node(v, insert value left, right)
| Node(v, left, right) when value > v -> Node(v, left, insert value right)
| Node(_, _, _) as n -> n
但我想添加一个整数列表,而不是添加一个整数。例子:
let tree = addList [5;2;1;6;7];;
并且列表应该添加到树中