为什么叶子在这部分不匹配?
99 | ......match t with
100 | | Node (Leaf, _, r) -> r
101 | | Node (l, _, Leaf) -> l
102 | | Node (l, _, r) ->
103 | let newy = max l in
104 | Node (remove newy l,newy, r)
Warning 8: this pattern-matching is not exhaustive.
Here is an example of a case that is not matched:
Leaf怎么让它起作用?
发布于 2022-03-06 01:01:54
您的匹配有三个选项,它们都是从Node开始的。我不认为有太多的问题,为什么没有匹配的Leaf。如果t是Leaf,那么它将不匹配这三种模式中的任何一种。
https://stackoverflow.com/questions/71366665
复制相似问题