Version française
Home     About     Download     Resources     Contact us    
Browse thread
type abbreviation for open polymorhic variants?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: nr@e...
Subject: type abbreviation for open polymorhic variants?
I wish to define an abbreviation for the following type:

         [> `Nil
    	 | `Number   of float
    	 | `String   of string
    	 | `Function of func
     	 | `Table    of table
         ]

I am assuming that the underlying machinery involves something like
row polymorphism, but I don't know how to name the 'row variable'.
I tried

  type 'a t = ['a 
              | `Nil
              | `Number   of float
              | `String   of string
              | `Function of func
              | `Table    of table
              ]

but this suggestion was roundly rejected by the compiler.

Does anybody know how to do this?  I couldn't find anything in the
syntax for polymorphic-variant type expressions.


Norman