I'm trying to create a type representing an empty binary tree (basically, only a skeleton of it). The variables of this type are then meant to be iterated over with pattern matching.
I understand how to instantiate a fixed from polymorphic variant for the standard types (int, string, etc) - see int_tree below. However, it is unclear if it is possible to make an empty variant from polymorphic one (empty_tree line below fails with SyntaxError during the compilation process).
The code is as follows:
type 'a binary_tree =
| Leaf of 'a
| Node of 'a binary_tree * 'a * 'a binary_tree
type int_tree = int binary_tree;;
type empty_tree = () binary_tree;;