I have a function delete_data which gives me an error "Unbound value delete_data" where it's "tree_map delete_data l". My delete function creates a new tree where the b is excluded in each node. As a homework rule, we aren't allowed to change the function to rec. What's the problem?
type 'a tree = Empty | Node of 'a * 'a tree * 'a tree
let rec tree_map f t = match t with
| Empty -> Empty
| Node(n, l, r) -> Node(f n , (tree_map f l), (tree_map f r));;
let delete_data t = match t with
Empty -> Empty
| Node((a,b), l, r) -> Node(a, tree_map delete_data l, tree_map delete_data r);;