caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Overriding an entry in a polymorphic variant
@ 2006-08-31 21:58 Yaron Minsky
  2006-08-31 22:04 ` Yaron Minsky
  0 siblings, 1 reply; 3+ messages in thread
From: Yaron Minsky @ 2006-08-31 21:58 UTC (permalink / raw)
  To: Caml Mailing List

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

Does anyone know if there is a clean way of overriding a field in a
polymorhphic variant.  I want to do something like this:

type bot = [ `bot ]
type top = [`bot | `top]
type t = [ `a of bot | `b of bot | `c of bot | `d of bot | `e of bot ]
type t1 = [ t | `c of top  | `e of top ]

the desired end result being that t1 is actually [ `a of bot | `b of bot |
`c of top | `d of bot | `e of top ].  I'm hoping to do this largely to
enable some phantom-types hackery I'm working on.  I'm not sure it matters
from the point of view of whether this is doable, but it is potentially
relevant that bot is a subtype of top.

Thanks in advance,
y

[-- Attachment #2: Type: text/html, Size: 694 bytes --]

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

end of thread, other threads:[~2006-08-31 23:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-31 21:58 Overriding an entry in a polymorphic variant Yaron Minsky
2006-08-31 22:04 ` Yaron Minsky
2006-08-31 23:29   ` [Caml-list] " skaller

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).