Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: nr@eecs.harvard.edu (Norman Ramsey)
To: caml-list@inria.fr
Subject: type abbreviation for open polymorhic variants?
Date: Thu, 18 Aug 2005 17:03:43 -0400 (EDT)	[thread overview]
Message-ID: <20050818210343.D8E391EB0C3@labrador.eecs.harvard.edu> (raw)

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



             reply	other threads:[~2005-08-18 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-18 21:03 Norman Ramsey [this message]
2005-08-18 21:45 ` [Caml-list] " Jacques Garrigue

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050818210343.D8E391EB0C3@labrador.eecs.harvard.edu \
    --to=nr@eecs.harvard.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox