From my understanding:
- OCaml uses rank 1 polymorphism
- In rank 1 polymorphism all quantifiers must be at the outermost (prenex) position
However the following is possible to type:
type 'a myArray = { map : 'b. ('a -> 'b) -> 'b myArray; }
Where the type quantifier 'b is nested. In fact, this can be used to simulate higher rank polymorphism in OCaml).
So can there be nested type quantifiers in rank-1 polymorphism, such as this case? And the type system is still predicative, i.e. full type inference is possible?