On 8/31/06, Yaron Minsky wrote: > > 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. > Small addendum: I'm still not sure this is relevant, but I did get my example slightly backwards. top should be a subtype of bot, not the other way. So the definitions of bot and top should be: type bot = [ `bot | `top] type top = [`top]