caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* records with polymorphic variants?
@ 2007-03-04  6:03 Eliot Handelman
  2007-03-04 12:04 ` [Caml-list] " Lukasz Stafiniak
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Eliot Handelman @ 2007-03-04  6:03 UTC (permalink / raw)
  To: caml

Hi,

I'm trying to figure out how to define a record with a field whose type 
is an extensible polymorphic variant.

I can  this:

type f = [ `A of int ]

type r = { x : f }  

but then I can't do this:

{ x = `B "test" }

I'm not even sure if what I'm asking for is possible.

Guessing at the syntax I tried

type  r = {
    f :  [> #foo]
  }

which results in:

Warning D: this syntax is deprecated.
      f :  [> #foo]
              ^^^^
Characters 24-28:
      f :  [> #foo]
              ^^^^
The type [< foo ] is not a polymorphic variant type

I hope it is clear what I'm trying to do. Thanks for your help.

-- eliot



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-03-05  8:02 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-04  6:03 records with polymorphic variants? Eliot Handelman
2007-03-04 12:04 ` [Caml-list] " Lukasz Stafiniak
2007-03-05  1:24   ` Jacques Garrigue
2007-03-04 12:08 ` Dmitri Boulytchev
2007-03-04 14:22 ` Zheng Li
2007-03-04 16:24   ` [Caml-list] " Lukasz Stafiniak
2007-03-04 16:50     ` Eliot Handelman
2007-03-04 21:02     ` Martin Jambon
2007-03-05  5:26       ` Eliot Handelman
2007-03-05  5:47         ` Martin Jambon
2007-03-05  8:01         ` Jacques GARRIGUE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).