如何更正此錯誤?OCaml我在哪裏犯了一個錯誤?
type 'a drzewo = | Puste | Wezel of 'a * 'a drzewo * 'a drzewo
let rec inorder t =
match t with
| Puste -> print_int (-1)
| Wezel (v, l, r) -> (inorder l; print_int v; inorder r)
let tree =
(1,
(Wezel (2, (Wezel (3, Puste, Puste)),
(Wezel (4, (Wezel (5, Puste, Puste)), Puste)))),
(Wezel (6, Puste, Puste)))
let _ = inorder tree
和日誌錯誤:
let _ = inorder tree;; Error: This expression has type int * int drzewo * int drzewo but an expression was expected of type int drzewo