From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id D969EBF54 for ; Thu, 31 Aug 2006 23:58:50 +0200 (CEST) Received: from wx-out-0506.google.com (wx-out-0506.google.com [66.249.82.228]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k7VLwnEb010774 for ; Thu, 31 Aug 2006 23:58:50 +0200 Received: by wx-out-0506.google.com with SMTP id s7so797992wxc for ; Thu, 31 Aug 2006 14:58:49 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:x-google-sender-auth; b=Q3IOdHs3KpwJfQpvq9WdKboahPuE6YKvz76JA/WdIV/jk8Rs8m6hR0vv9OCP0URL3cPbx5eAbDP0+hkhKivOYHymVghgdtAhHIFlOlLyLAFxJ5F4PQGmGE+qLoC81eimUVuECm2SwjQaerysdj27fA6PO8TYgx0GtgDP8agfNKc= Received: by 10.70.98.17 with SMTP id v17mr1350964wxb; Thu, 31 Aug 2006 14:58:49 -0700 (PDT) Received: by 10.70.61.6 with HTTP; Thu, 31 Aug 2006 14:58:49 -0700 (PDT) Message-ID: <891bd3390608311458v5de0651qd8a38a896c77c72d@mail.gmail.com> Date: Thu, 31 Aug 2006 17:58:49 -0400 From: "Yaron Minsky" Sender: yminsky@gmail.com To: "Caml Mailing List" Subject: Overriding an entry in a polymorphic variant MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_72663_30628698.1157061529475" X-Google-Sender-Auth: bb146a80ae907d3d X-Miltered: at concorde with ID 44F75B9A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; yaron:01 minsky:01 yminsky:01 overriding:01 overriding:01 hackery:01 doable:01 subtype:01 hackery:01 doable:01 subtype:01 polymorphic:01 cornell:01 variant:02 variant:02 ------=_Part_72663_30628698.1157061529475 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 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 ------=_Part_72663_30628698.1157061529475 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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
------=_Part_72663_30628698.1157061529475--