OCaml functor taking polymorphic variant type
type t = [> `Foo]
is invalid since [> `Foo]
is an open type and contains a type variable implicitly. The definition is rejected just as the following type definition is rejected since the RHS has a type variable which is not quantified in LHS:
type t = 'a list
You have to make it closed:
type t = [ `Foo ]
or quantify the type variable:
type 'a t = [> `Foo] as 'a
which is equivalent to
type 'a t = 'a constraint 'a = [> `Foo]