我有一个Person类,我在TreeMap中使用它作为密钥。我还实现了Comparable,以便TreeMap能够进行排序。getters and setters were omittedpublic int compareTo(Object o) {}现在,我创建了TreeMap并在其中添加了值如下:
treeMap.put(new
treeMap :: (a -> b) -> tree a -> tree btreeMap f (Node left right) = Node(treeMap f left) (treeMap f right)Constructor `Node' should have 3 arguments, but hasbeen given 2
In the pattern: Node left r