Here is my code
type arbre= Feuille of int | Noeud of arbre*int*arbre;;
let monarbre= Noeud(Noeud(Feuille(1),2,Noeud(Feuille(6),9,Feuille(7))),4,Feuille(8));;
let rec occ n a= let cpt=0 in
match a with
Feuille _ -> 0
|Noeud(g,v,d)-> if v=n then cpt+1
else if occ n g then cpt+1
else if occ n d then cpt+1
;;
i want to counts the occurence in this tree but always have a error message like this
File "main.ml", line 8, characters 12-19: Error: This expression has type int but an expression was expected of type bool Can someone help me?