From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id B622ABB83 for ; Thu, 14 Sep 2006 06:36:45 +0200 (CEST) Received: from mail3.sea5.speakeasy.net (mail3.sea5.speakeasy.net [69.17.117.5]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8E4ahpf008967 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 14 Sep 2006 06:36:45 +0200 Received: (qmail 1202 invoked from network); 14 Sep 2006 04:36:36 -0000 Received: from shell2.sea5.speakeasy.net ([69.17.116.3]) (envelope-sender ) by mail3.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 14 Sep 2006 04:36:36 -0000 Date: Wed, 13 Sep 2006 21:36:36 -0700 (PDT) From: brogoff To: caml-list@inria.fr Subject: Re: [Caml-list] Comparing two things of any two types, in pure OCaml In-Reply-To: <20060909.161349.09849160.garrigue@math.nagoya-u.ac.jp> Message-ID: References: <20060909031139.04B8AAC00@Adric.metnet.fnmoc.navy.mil> <20060909.161349.09849160.garrigue@math.nagoya-u.ac.jp> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at discorde with ID 4508DC5B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 annotation:01 datatypes:01 annotations:01 variants:01 variants:01 inference:01 annotation:01 2006,:98 wrote:01 wrote:01 polymorphic:01 polymorphic:01 caml-list:01 functions:01 On Sat, 9 Sep 2006, Jacques Garrigue wrote: > > Jacques Garrigue suggested using Obj.repr. He also wrote ``Type > > theoretician answer: What you would need to do that transparently > > inside the type system is generic functions with dynamics.'' and > > mentioned GADT. > > Small comment: By transparently I meant "without any type > annotation". Then I gave a solution using normal datatypes for > annotations, and polymorphic methods, and just mentioned that GADTs > were not useful in this case. Note that my solution cannot directly > use polymorphic variants, it uses non-regular types, and > polymorphic variants have to be regular. Is that to make type inference tractable? If so, any ideas on what amount of annotation would be needed to get around this? > This said, I love polymorphic variants anyway... I like them a lot, and I often wish there was a dual notion of polymorphic records in Caml as well. But now I wonder about the non-regular types issue you bring up; I guess it means that you need plain old sum types too if you wish to use them. -- Brian