From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 4AB3ABC48 for ; Thu, 7 Apr 2005 02:12:41 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j370CeVN020318 for ; Thu, 7 Apr 2005 02:12:40 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id CAA21051 for ; Thu, 7 Apr 2005 02:12:40 +0200 (MET DST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j370CdKe032063 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Thu, 7 Apr 2005 02:12:39 +0200 Received: from root by ciao.gmane.org with local (Exim 4.43) id 1DJKbF-0006mK-8L for caml-list@inria.fr; Thu, 07 Apr 2005 02:10:21 +0200 Received: from denali.ccs.neu.edu ([129.10.116.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Apr 2005 02:10:21 +0200 Received: from ethan.aubin by denali.ccs.neu.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 07 Apr 2005 02:10:21 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Ethan Aubin Subject: Re: ambitious proposal: polymorphic arithmetics Date: Thu, 7 Apr 2005 00:01:27 +0000 (UTC) Message-ID: References: <20050406.111505.68543084.eijiro_sumii@anet.ne.jp> <20050406155608.GA17518@furbychan.cocan.org> <42541195.8030807@jetbrains.com> <20050406185901.GA6338@furbychan.cocan.org> X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: denali.ccs.neu.edu User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (SunOS/5.9 (sun4u)) Sender: news X-Miltered: at concorde with ID 42547AF8.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42547AF7.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; simulate:01 statically:01 printf:01 popl:01 hongwei:01 ocaml:01 lomov:01 g'caml:01 constructors:01 non-uniform:01 simulate:01 03.:98 wrote:01 wrote:01 polymorphic:01 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: Gadts can do for all sorts of cool things. For example, an approach to simulate type classes with gadts see http://www.cs.bu.edu/~hwxi/GRecTypecon/PAPER/main.pdf, to create a statically typed printf see http://www.cs.bu.edu/~hwxi/academic/papers/popl03.pdf Hongwei Xi and Tim Sheard's papers have tons of interesting examples in their publications. I hope some ideas from their languages, ATS and Omega respectively, trickle down to Ocaml. > On Wed, Apr 06, 2005 at 08:43:01PM +0400, Dmitry Lomov wrote: >> Richard Jones wrote: >> >The problem, I'm guessing, is that you add polymorphic +, -, and so >> >on. But that's really just a hack in the language. Sooner or later >> >people are going to ask why it's not possible to write a polymorphic >> >'print' function, _without_ hacking the language some more. At that >> >point you need a theory, and you need something like G'Caml, or type >> >classes, or GADTS. >> >> Pardon my ignorance, but how are GADTs are going to help in this regard? >> I thought GADTs are basically data types with constructors that have >> non-uniform "return type". > Pardon _my_ ignorance. I read something about using GADTs to simulate > class types in the paper, and assumed that they are equivalent, but > I'm probably wrong. Also, sorry for any duplicate post.