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 43EABBB84 for ; Wed, 10 May 2006 20:44:53 +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 k4AIiqNd018612 for ; Wed, 10 May 2006 20:44:52 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id UAA24164 for ; Wed, 10 May 2006 20:44:52 +0200 (MET DST) Received: from hugh.cs.washington.edu (hugh.cs.washington.edu [128.208.2.43]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k4AIin1s018609 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 10 May 2006 20:44:51 +0200 Received: from [128.208.2.33] (gerald.cs.washington.edu [128.208.2.33]) by hugh.cs.washington.edu (8.13.6/8.13.5/1.5) with ESMTP id k4AIimfr017694; Wed, 10 May 2006 11:44:48 -0700 (envelope-from djg@cs.washington.edu) Message-ID: <4462349B.7070204@cs.washington.edu> Date: Wed, 10 May 2006 11:44:43 -0700 From: Dan Grossman User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Geoffrey Alan Washburn Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: OO design References: <53c655920605050235k64e70333je8df813239ea3c53@mail.gmail.com> <20060508.121743.65190532.garrigue@math.nagoya-u.ac.jp> <200605082329.36911.David.Teller@ens-lyon.org> <445FB9C7.4040703@cs.washington.edu> <446152CB.5010605@cis.upenn.edu> <44621204.4020601@cs.washington.edu> <44622DD5.7050304@cis.upenn.edu> In-Reply-To: <44622DD5.7050304@cis.upenn.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 446234A4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 446234A1.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; first-order:01 subtyping:01 coercions:01 val:01 val:01 inlining:01 enforces:01 monadic:01 beginner's:01 ocaml:01 beginners:01 bug:01 wrote:01 wrote:01 writes:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 I believe http://arxiv.org/abs/cs.PL/0403034 is relevant, claiming that phantom types can encode any first-order subtyping hierarchy. If I recall correctly, you force the client to provide "witnesses" (i.e., coercions), which to answer a later question in the thread, is how you can support things like passing a "read_write" file handle to read. That is, you have a functions like: val up_to_read : read_write file -> read file val up_to_write : read_write file -> write file These are the identity function and we can expect cross-module inlining to remove them. --Dan Geoffrey Alan Washburn wrote: > Dan Grossman wrote: > >> It enforces that you don't confuse your reads and writes, but *not* >> that you don't use a file after you close it. A monadic approach >> (where each operation would return a "new" file) or linearity appears >> necessary for the latter. > > > Okay, good point. However, that raises the interesting question of > whether there is a nice positive specification of the class of > "protocols" that are expressible in the presence of effects, rather than > a negative characterization -- all those that can be broken by aliasing, > nontermination, etc. > > _______________________________________________ > Caml-list mailing list. Subscription management: > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list > Archives: http://caml.inria.fr > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs