I'd like to hear the answers to some questions asked on Twitter, that Anil began replying to:

The original question was: Does anyone know why OCaml doesn't allow defining types with polymorphic row variables: <red: int; ..> or [> `Red ] but will infer them?

Anil's answer was to use:

    type 'a t constraint 'a = [> `Red ]
    type 'a t constraint 'a = <x:int; ..>

Here are the follow up questions that could still use some clarification:

1. Does anyone know how can we later instantiate the polymorphic row variables ".." with particular rows (both for obj methods and variants). Any good docs on this? How do we assert that another type/expression is equivalent to 'a t with 'a being a particular set of rows.

Could someone give an example with a 2D point type

type 'a twoDimensionalPoint constraint 'a = <x:int; y:int; ..>;;

How would we create another type threeDimensionalPoint that we assert is a two dimensional point with the polymorphic row variables being set to `z:int`? I understand type inference/checking automates most of this, but I often like to explicitly write type definitions to verify my own understanding of the program/inference.

3. Also curious why annotations in arguments don't require acknowledgment of row polymorphism

  let f (o:<x:int; y:int; ..>) = o#x + o#y;;

4. It appears there are two ways to write the row-polymorphic type annotation:
type 'a t = ([> `Red ] as 'a) and type 'a t constraint 'a = [> `Red ]. Why are there two ways and what are the advantages?